Skip to content

Commit

Permalink
Require CBlockIndex::IsValid() to hold cs_main
Browse files Browse the repository at this point in the history
Summary:
This is a partial backport of [[bitcoin/bitcoin#22932 | core#22932]]
bitcoin/bitcoin@ca47b00

Depends on D13035

Test Plan:
With clang and DEBUG:

`ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13036
  • Loading branch information
PiRK committed Jan 24, 2023
1 parent 7b92966 commit 20237de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/blockindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ class CBlockIndex {

//! Check whether this block index entry is valid up to the passed validity
//! level.
bool IsValid(enum BlockValidity nUpTo = BlockValidity::TRANSACTIONS) const {
bool IsValid(enum BlockValidity nUpTo = BlockValidity::TRANSACTIONS) const
EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
AssertLockHeld(::cs_main);
return nStatus.isValid(nUpTo);
}

Expand Down

0 comments on commit 20237de

Please sign in to comment.