aboutsummaryrefslogtreecommitdiff
path: root/src/chain.h
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2022-01-19 14:03:23 +0100
committerJon Atack <jon@atack.com>2022-01-25 20:43:25 +0100
commit8ef457cb83fac796f8b6a56977b1016193fc1185 (patch)
tree7fc5ace30382fbfea8bd7429084eebbefe75d906 /src/chain.h
parent572393448b4d32f91b92edc84b4200ab52d62422 (diff)
downloadbitcoin-8ef457cb83fac796f8b6a56977b1016193fc1185.tar.xz
Require CBlockIndex::IsAssumedValid() to hold cs_main
Diffstat (limited to 'src/chain.h')
-rw-r--r--src/chain.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/chain.h b/src/chain.h
index fc89599bd1..2eb780d499 100644
--- a/src/chain.h
+++ b/src/chain.h
@@ -320,7 +320,11 @@ public:
//! @returns true if the block is assumed-valid; this means it is queued to be
//! validated by a background chainstate.
- bool IsAssumedValid() const { return nStatus & BLOCK_ASSUMED_VALID; }
+ bool IsAssumedValid() const EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
+ {
+ AssertLockHeld(::cs_main);
+ return nStatus & BLOCK_ASSUMED_VALID;
+ }
//! Raise the validity level of this block index entry.
//! Returns true if the validity was changed.