lbrycrd/src/wallet/test
Russell Yanofsky de9a1db2ed 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 <luke-jr@utopios.org> in
https://botbot.me/freenode/bitcoin-core-dev/msg/90244330/
2017-08-24 14:12:21 -04:00
..
accounting_tests.cpp scripted-diff: Remove #include <boost/foreach.hpp> 2017-06-22 03:48:52 +02:00
crypto_tests.cpp tests: Remove OldSetKeyFromPassphrase/OldEncrypt/OldDecrypt 2017-08-14 17:52:06 +02:00
wallet_test_fixture.cpp scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
wallet_test_fixture.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
wallet_tests.cpp Acquire cs_main lock before cs_wallet during wallet initialization 2017-08-24 14:12:21 -04:00