mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 04:12:36 -03:00
init: add missing cs_main lock
BlockManager::m_block_tree_db is protected by cs_main, so take the cs_main lock while accessing it.
This commit is contained in:
parent
7c08d81e11
commit
0346c26fca
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue