From ca47b005770f71aa229ecc1f7b8146a96ff02151 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Wed, 19 Jan 2022 14:03:46 +0100 Subject: [PATCH] Require CBlockIndex::IsValid() to hold cs_main --- src/chain.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chain.h b/src/chain.h index c2a9cba1e6..fbc033281f 100644 --- a/src/chain.h +++ b/src/chain.h @@ -311,7 +311,9 @@ public: //! Check whether this block index entry is valid up to the passed validity level. bool IsValid(enum BlockStatus nUpTo = BLOCK_VALID_TRANSACTIONS) const + EXCLUSIVE_LOCKS_REQUIRED(::cs_main) { + AssertLockHeld(::cs_main); assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed. if (nStatus & BLOCK_FAILED_MASK) return false;