test: Fix inconsistent lock order in wallet_tests/CreateWallet
Summary:
sync: Improve CheckLastCritical()
This commit adds actual lock stack logging if check fails.
[skip ci] sync: Check precondition in LEAVE_CRITICAL_SECTION() macro
This change reveals a bug in the wallet_tests/CreateWalletFromFile test,
that will be fixed in the following commit.
test: Fix inconsistent lock order in wallet_tests/CreateWallet
This is a backport of core#19982
Test Plan:
I confirmed that after commit #2, running ninja check with -DCMAKE_BUILD_TYPE=Debug reveals a lock order issue:
../src/wallet/test/wallet_tests.cpp:853 wallet_param->wallet()->cs_wallet was not most recent critical section locked, details in debug log.
This goes away with the next commit.
Tested also with TSAN, after removing the suppression.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D11093