Skip to content

Commit f10b24a

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#24672: init: add missing cs_main lock
0346c26 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 0346c26 Tree-SHA512: d6dff0b2d58871c7fbb281558b59fa9ad26fa75b3ceca9232277fc49ab795325e5ac3d266db49e7bda33da6de0b014b1bdebdf2c2c4347d43e50c0433a2cf06c
2 parents 9344697 + 0346c26 commit f10b24a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
15411541

15421542
// ********************************************************* Step 8: start indexers
15431543
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX)) {
1544-
if (const auto error{CheckLegacyTxindex(*Assert(chainman.m_blockman.m_block_tree_db))}) {
1544+
if (const auto error{WITH_LOCK(cs_main, return CheckLegacyTxindex(*Assert(chainman.m_blockman.m_block_tree_db)))}) {
15451545
return InitError(*error);
15461546
}
15471547

0 commit comments

Comments
 (0)