diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2022-01-19 14:03:46 +0100 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-01-25 20:43:31 +0100 |
commit | ca47b005770f71aa229ecc1f7b8146a96ff02151 (patch) | |
tree | 51a641434f0173e1e5e8184a9979d94a36237560 /src | |
parent | e9f3aa5f6a7b39e8d5f2069617e5e382798d8d60 (diff) |
Require CBlockIndex::IsValid() to hold cs_main
Diffstat (limited to 'src')
-rw-r--r-- | src/chain.h | 2 |
1 files changed, 2 insertions, 0 deletions
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; |