diff options
author | Anthony Towns <aj@erisian.com.au> | 2022-03-23 13:50:39 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2022-03-26 00:04:07 +1000 |
commit | 0346c26fcacca8abcf67f7320fd441e564aa97d1 (patch) | |
tree | 845a6e103cfd01638d442eaf7a90b80da9c726c2 | |
parent | 7c08d81e119570792648fe95bbacddbb1d5f9ae2 (diff) |
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.
-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); } |