mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
refactor: make MempoolMutex() public
for use in the following unittests.
This commit is contained in:
@@ -748,6 +748,12 @@ public:
|
|||||||
|
|
||||||
std::string ToString() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
std::string ToString() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||||
|
|
||||||
|
//! Indirection necessary to make lock annotations work with an optional mempool.
|
||||||
|
RecursiveMutex* MempoolMutex() const LOCK_RETURNED(m_mempool->cs)
|
||||||
|
{
|
||||||
|
return m_mempool ? &m_mempool->cs : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool ActivateBestChainStep(BlockValidationState& state, CBlockIndex* pindexMostWork, const std::shared_ptr<const CBlock>& pblock, bool& fInvalidFound, ConnectTrace& connectTrace) EXCLUSIVE_LOCKS_REQUIRED(cs_main, m_mempool->cs);
|
bool ActivateBestChainStep(BlockValidationState& state, CBlockIndex* pindexMostWork, const std::shared_ptr<const CBlock>& pblock, bool& fInvalidFound, ConnectTrace& connectTrace) EXCLUSIVE_LOCKS_REQUIRED(cs_main, m_mempool->cs);
|
||||||
bool ConnectTip(BlockValidationState& state, CBlockIndex* pindexNew, const std::shared_ptr<const CBlock>& pblock, ConnectTrace& connectTrace, DisconnectedBlockTransactions& disconnectpool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, m_mempool->cs);
|
bool ConnectTip(BlockValidationState& state, CBlockIndex* pindexNew, const std::shared_ptr<const CBlock>& pblock, ConnectTrace& connectTrace, DisconnectedBlockTransactions& disconnectpool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, m_mempool->cs);
|
||||||
@@ -761,12 +767,6 @@ private:
|
|||||||
void CheckForkWarningConditions() EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
void CheckForkWarningConditions() EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||||
void InvalidChainFound(CBlockIndex* pindexNew) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
void InvalidChainFound(CBlockIndex* pindexNew) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||||
|
|
||||||
//! Indirection necessary to make lock annotations work with an optional mempool.
|
|
||||||
RecursiveMutex* MempoolMutex() const LOCK_RETURNED(m_mempool->cs)
|
|
||||||
{
|
|
||||||
return m_mempool ? &m_mempool->cs : nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make mempool consistent after a reorg, by re-adding or recursively erasing
|
* Make mempool consistent after a reorg, by re-adding or recursively erasing
|
||||||
* disconnected block transactions from the mempool, and also removing any
|
* disconnected block transactions from the mempool, and also removing any
|
||||||
|
|||||||
Reference in New Issue
Block a user