mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Merge #15321: doc: Add cs_main lock annotations for mapBlockIndex
fa2a69fcb9 doc: Add cs_main lock annotations for mapBlockIndex (practicalswift)
Pull request description:
Marked as "doc" because it didn't change the bitcoind on my system with default configure settings for both gcc and clang.
Tree-SHA512: ba203f16c1cdc834a61c65bb5fb20bbaf7d8bff0c3a1b8ef46bc1d3669092191221e26abd7e580efab2f9bd5a992dc363251f1b68c6cd68f8204d62675868cf1
This commit is contained in:
@@ -44,6 +44,7 @@ BOOST_FIXTURE_TEST_CASE(scan_for_wallet_transactions, TestChain100Setup)
|
||||
CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey()));
|
||||
CBlockIndex* newTip = chainActive.Tip();
|
||||
|
||||
LockAnnotation lock(::cs_main);
|
||||
auto locked_chain = chain->lock();
|
||||
|
||||
// Verify ScanForWalletTransactions accommodates a null start block.
|
||||
@@ -123,6 +124,7 @@ BOOST_FIXTURE_TEST_CASE(importmulti_rescan, TestChain100Setup)
|
||||
CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey()));
|
||||
CBlockIndex* newTip = chainActive.Tip();
|
||||
|
||||
LockAnnotation lock(::cs_main);
|
||||
auto locked_chain = chain->lock();
|
||||
|
||||
// Prune the older block file.
|
||||
@@ -268,6 +270,7 @@ static int64_t AddTx(CWallet& wallet, uint32_t lockTime, int64_t mockTime, int64
|
||||
SetMockTime(mockTime);
|
||||
CBlockIndex* block = nullptr;
|
||||
if (blockTime > 0) {
|
||||
LockAnnotation lock(::cs_main);
|
||||
auto locked_chain = wallet.chain().lock();
|
||||
auto inserted = mapBlockIndex.emplace(GetRandHash(), new CBlockIndex);
|
||||
assert(inserted.second);
|
||||
|
||||
Reference in New Issue
Block a user