diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-03-25 16:20:50 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-03-25 16:20:53 +0100 |
commit | f10b24ad2943095f964a6b03ba202c2cfbacdf23 (patch) | |
tree | 6abeb118ec13960bab9cda80f78d9c4c2b6cb8b2 /src | |
parent | 9344697e57bd23d955df493d0581193ca1dc7cca (diff) | |
parent | 0346c26fcacca8abcf67f7320fd441e564aa97d1 (diff) |
Merge bitcoin/bitcoin#24672: init: add missing cs_main lock
0346c26fcacca8abcf67f7320fd441e564aa97d1 init: add missing cs_main lock (Anthony Towns)
Pull request description:
`BlockManager::m_block_tree_db` is protected by `cs_main`, so take the
`cs_main` lock while accessing it.
ACKs for top commit:
jonatack:
Code review ACK 0346c26fcacca8abcf67f7320fd441e564aa97d1
Tree-SHA512: d6dff0b2d58871c7fbb281558b59fa9ad26fa75b3ceca9232277fc49ab795325e5ac3d266db49e7bda33da6de0b014b1bdebdf2c2c4347d43e50c0433a2cf06c
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index de78fdb7b4..f934fd751d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1541,7 +1541,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) // ********************************************************* Step 8: start indexers if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX)) { - if (const auto error{CheckLegacyTxindex(*Assert(chainman.m_blockman.m_block_tree_db))}) { + if (const auto error{WITH_LOCK(cs_main, return CheckLegacyTxindex(*Assert(chainman.m_blockman.m_block_tree_db)))}) { return InitError(*error); } |