-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #949: [Wallet] Lock cs_wallet in additional places.
c9cdb22 Lock cs_wallet in additional places. (Zannick) Pull request description: ### Problem tsan identifies a data race within WalletBatch, commonly between KeepKey and AddToWallet. ### Solution Declare CWallet::KeepKey as requiring `cs_wallet`, and take it before all calls as prescribed by clang. (This moved the tsan data race to the nearby fields of CReserveKey, which was mitigated by including their access within the lock.) Add another cs_wallet use per clang warning: AddKeyPubKey requires holding mutex 'pwalletParent->cs_wallet' exclusively. ### Tested Configured with --with-sanitizers=thread, built with clang, and run on regtest. tsan warnings for this area no longer appear. Tree-SHA512: 07ab9ac13404c270178c5c60bc68289c5d2cb933811ed18bdc2f7556d686ff5f511fe39af4cd923417e76950d010217dd7bee0381ab350c58dffc76c6a09a682
- Loading branch information
Showing
3 changed files
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters