aboutsummaryrefslogtreecommitdiff
path: root/src/script/script_error.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <[email protected]>2017-08-24 14:12:21 -0400
committerRussell Yanofsky <[email protected]>2017-08-24 14:12:21 -0400
commitde9a1db2ed14e0c75ffd82dc031f7ad30c56d195 (patch)
treea1da4e7317799469c078b5923a4aba3ae7ffc0aa /src/script/script_error.cpp
parentMerge #11077: [tests] fix timeout issues from TestNode (diff)
downloaddiscoin-de9a1db2ed14e0c75ffd82dc031f7ad30c56d195.tar.xz
discoin-de9a1db2ed14e0c75ffd82dc031f7ad30c56d195.zip
Acquire cs_main lock before cs_wallet during wallet initialization
CWallet::MarkConflicted may acquire the cs_main lock after CWalletDB::LoadWallet acquires the cs_wallet lock during wallet initialization. (CWalletDB::LoadWallet calls ReadKeyValue which calls CWallet::LoadToWallet which calls CWallet::MarkConflicted). This is the opposite order that cs_main and cs_wallet locks are acquired in the rest of the code, and so leads to POTENTIAL DEADLOCK DETECTED errors if bitcoin is built with -DDEBUG_LOCKORDER. This commit changes CWallet::LoadWallet (which calls CWalletDB::LoadWallet) to acquire both locks in the standard order. It also fixes some tests that were acquiring wallet and main locks out of order and failed with the new locking in CWallet::LoadWallet. Error was reported by Luke Dashjr <[email protected]> in https://botbot.me/freenode/bitcoin-core-dev/msg/90244330/
Diffstat (limited to 'src/script/script_error.cpp')
0 files changed, 0 insertions, 0 deletions