diff options
author | w0xlt <94266259+w0xlt@users.noreply.github.com> | 2022-01-19 18:47:54 -0300 |
---|---|---|
committer | w0xlt <94266259+w0xlt@users.noreply.github.com> | 2022-01-24 13:15:08 -0300 |
commit | ddeefeef20fa2fe48c3c4563370a6297704d228e (patch) | |
tree | e43414d616bcf3fc70f217a7221f10d56b61fe7e /src/validation.cpp | |
parent | 1dfd31bc267c54144a7e62ad5a1a5860c032f4d7 (diff) |
refactor: add negative TS annotations for `m_chainstate_mutex`
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 7c0654c2c6..bc69bc4230 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2821,6 +2821,8 @@ static void LimitValidationInterfaceQueue() LOCKS_EXCLUDED(cs_main) { bool CChainState::ActivateBestChain(BlockValidationState& state, std::shared_ptr<const CBlock> pblock) { + AssertLockNotHeld(m_chainstate_mutex); + // Note that while we're often called here from ProcessNewBlock, this is // far from a guarantee. Things in the P2P/RPC will often end up calling // us in the middle of ProcessNewBlock - do not assume pblock is set @@ -2950,6 +2952,8 @@ bool CChainState::PreciousBlock(BlockValidationState& state, CBlockIndex* pindex bool CChainState::InvalidateBlock(BlockValidationState& state, CBlockIndex* pindex) { + AssertLockNotHeld(m_chainstate_mutex); + // Genesis block can't be invalidated assert(pindex); if (pindex->nHeight == 0) return false; |