mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
Require CBlockIndex::IsValid() to hold cs_main
This commit is contained in:
parent
e9f3aa5f6a
commit
ca47b00577
1 changed files with 2 additions and 0 deletions
|
@ -311,7 +311,9 @@ public:
|
||||||
|
|
||||||
//! Check whether this block index entry is valid up to the passed validity level.
|
//! Check whether this block index entry is valid up to the passed validity level.
|
||||||
bool IsValid(enum BlockStatus nUpTo = BLOCK_VALID_TRANSACTIONS) const
|
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.
|
assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed.
|
||||||
if (nStatus & BLOCK_FAILED_MASK)
|
if (nStatus & BLOCK_FAILED_MASK)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue