From 6d452845dc8caf2c77231218a508676e35180bdf Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Mon, 7 Oct 2024 01:09:14 +0700 Subject: [PATCH] fix: add missing lock annotation for ContextualCheckBlock and related TODO --- src/validation.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/validation.cpp b/src/validation.cpp index 38a030ace1..afd909c993 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3644,9 +3644,10 @@ static bool ContextualCheckBlockHeader(const CBlockHeader& block, BlockValidatio * in ConnectBlock(). * Note that -reindex-chainstate skips the validation that happens here! */ -static bool ContextualCheckBlock(const CBlock& block, BlockValidationState& state, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev) +static bool ContextualCheckBlock(const CBlock& block, BlockValidationState& state, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) { - AssertLockHeld(cs_main); + // TODO: validate - why do we need this cs_main ? + AssertLockHeld(::cs_main); const int nHeight = pindexPrev == nullptr ? 0 : pindexPrev->nHeight + 1; // Enforce BIP113 (Median Time Past).