Require CBlockIndex::RaiseValidity() to hold cs_main
This commit is contained in:
1 parent
8ef457cb83
commit
e9f3aa5f6a
2 files changed
+3
-2
No files matched your search
+2
-1
@@ -328,8 +328,9 @@ public:
|
|||||||
|
|
||||||
//! Raise the validity level of this block index entry.
|
//! Raise the validity level of this block index entry.
|
||||||
//! Returns true if the validity was changed.
|
//! Returns true if the validity was changed.
|
||||||
bool RaiseValidity(enum BlockStatus nUpTo)
|
bool RaiseValidity(enum BlockStatus nUpTo) 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) return false;
|
if (nStatus & BLOCK_FAILED_MASK) return false;
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ FUZZ_TARGET(chain)
|
|||||||
if (block_status & ~BLOCK_VALID_MASK) {
|
if (block_status & ~BLOCK_VALID_MASK) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
(void)disk_block_index->RaiseValidity(block_status);
|
WITH_LOCK(::cs_main, (void)disk_block_index->RaiseValidity(block_status));
|
||||||
}
|
}
|
||||||
|
|
||||||
CBlockIndex block_index{block_header};
|
CBlockIndex block_index{block_header};
|
||||||
|
|||||||
Reference in new issue
Block a user