HomePhabricator

Merge #12333: Make CWallet::ListCoins atomic

Description

Merge #12333: Make CWallet::ListCoins atomic

Summary:
1beea7a [wallet] Make CWallet::ListCoins atomic (João Barbosa)

Pull request description:

Fix a potencial race in `CWallet::ListCoins`.

Replaces `cs_main` and `cs_wallet` locks by assertions in `CWallet::AvailableCoins`.

Tree-SHA512: 09109f44a08b4b53f7605d950ab506d3f748490ab9aed474aa200e93f7b0b9f96f9bf60abe1c5f658240fd13d9e3267c0dd43fd3c1695d82384198ce1da8109f

Backport of Core PR12333
https://github.com/bitcoin/bitcoin/pull/12333/

Note: 2f960b5 [wallet] Indent only change of CWallet::AvailableCoins (João Barbosa) was skipped because our linter made the changes unnecessary. I also verified that cherry-picking this commit resulted in no change to the code.

Test Plan:

../configure --enable-debug
make check
make check should not throw any locking errors.

Reviewers: jasonbcox, deadalnix, Fabien, markblundeberg, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, Fabien, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D3049

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Feb 8 2018, 18:44
nakihitoCommitted on Jun 3 2019, 17:25
deadalnixPushed on Jun 3 2019, 19:22
Reviewer
Restricted Owners Package
Differential Revision
D3049: Merge #12333: Make CWallet::ListCoins atomic
Parents
rSTAGINGc747648744db: Improve ZMQ functional test
Branches
Unknown
Tags
Unknown