merge bitcoin#24235: use stronger EXCLUSIVE_LOCKS_REQUIRED()

This commit is contained in:
Kittywhiskers Van Gogh 2022-02-02 09:08:00 +01:00
parent edc665c80d
commit 678e67c505
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -602,7 +602,8 @@ public:
EXCLUSIVE_LOCKS_REQUIRED(::cs_main); EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
/** Import blocks from an external file */ /** Import blocks from an external file */
void LoadExternalBlockFile(FILE* fileIn, FlatFilePos* dbp = nullptr); void LoadExternalBlockFile(FILE* fileIn, FlatFilePos* dbp = nullptr)
EXCLUSIVE_LOCKS_REQUIRED(!m_chainstate_mutex);
/** /**
* Update the on-disk chain state. * Update the on-disk chain state.
@ -644,7 +645,9 @@ public:
*/ */
bool ActivateBestChain( bool ActivateBestChain(
BlockValidationState& state, BlockValidationState& state,
std::shared_ptr<const CBlock> pblock = nullptr) LOCKS_EXCLUDED(m_chainstate_mutex, cs_main); std::shared_ptr<const CBlock> pblock = nullptr)
EXCLUSIVE_LOCKS_REQUIRED(!m_chainstate_mutex)
LOCKS_EXCLUDED(::cs_main);
bool AcceptBlock(const std::shared_ptr<const CBlock>& pblock, BlockValidationState& state, CBlockIndex** ppindex, bool fRequested, const FlatFilePos* dbp, bool* fNewBlock) EXCLUSIVE_LOCKS_REQUIRED(cs_main); bool AcceptBlock(const std::shared_ptr<const CBlock>& pblock, BlockValidationState& state, CBlockIndex** ppindex, bool fRequested, const FlatFilePos* dbp, bool* fNewBlock) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
@ -660,11 +663,20 @@ public:
* *
* May not be called in a validationinterface callback. * May not be called in a validationinterface callback.
*/ */
bool PreciousBlock(BlockValidationState& state, CBlockIndex* pindex) LOCKS_EXCLUDED(cs_main); bool PreciousBlock(BlockValidationState& state, CBlockIndex* pindex)
EXCLUSIVE_LOCKS_REQUIRED(!m_chainstate_mutex)
LOCKS_EXCLUDED(::cs_main);
/** Mark a block as invalid. */ /** Mark a block as invalid. */
bool InvalidateBlock(BlockValidationState& state, CBlockIndex* pindex) LOCKS_EXCLUDED(m_chainstate_mutex, cs_main); bool InvalidateBlock(BlockValidationState& state, CBlockIndex* pindex)
EXCLUSIVE_LOCKS_REQUIRED(!m_chainstate_mutex)
LOCKS_EXCLUDED(::cs_main);
/** Enforce a block marking all the other chains as conflicting. */ /** Enforce a block marking all the other chains as conflicting. */
void EnforceBlock(BlockValidationState& state, const CBlockIndex* pindex) LOCKS_EXCLUDED(m_chainstate_mutex, cs_main); void EnforceBlock(BlockValidationState& state, const CBlockIndex* pindex)
EXCLUSIVE_LOCKS_REQUIRED(!m_chainstate_mutex)
LOCKS_EXCLUDED(::cs_main);
/** Remove invalidity status from a block and its descendants. */ /** Remove invalidity status from a block and its descendants. */
void ResetBlockFailureFlags(CBlockIndex* pindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main); void ResetBlockFailureFlags(CBlockIndex* pindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main);