@@ -2725,6 +2725,7 @@ bool CChainState::ActivateBestChainStep(BlockValidationState& state, const CChai
2725
2725
{
2726
2726
AssertLockHeld (cs_main);
2727
2727
AssertLockHeld (m_mempool.cs );
2728
+ assert (std::addressof (::ChainstateActive ()) == std::addressof (*this ));
2728
2729
2729
2730
const CBlockIndex* pindexOldTip = m_chain.Tip ();
2730
2731
const CBlockIndex* pindexFork = m_chain.FindFork (pindexMostWork);
@@ -2736,7 +2737,7 @@ bool CChainState::ActivateBestChainStep(BlockValidationState& state, const CChai
2736
2737
if (!DisconnectTip (state, chainparams, &disconnectpool)) {
2737
2738
// This is likely a fatal error, but keep the mempool consistent,
2738
2739
// just in case. Only remove from the mempool in this case.
2739
- UpdateMempoolForReorg (:: ChainstateActive () , m_mempool, disconnectpool, false );
2740
+ UpdateMempoolForReorg (* this , m_mempool, disconnectpool, false );
2740
2741
2741
2742
// If we're unable to disconnect a block during normal operation,
2742
2743
// then that is a failure of our local system -- we should abort
@@ -2780,7 +2781,7 @@ bool CChainState::ActivateBestChainStep(BlockValidationState& state, const CChai
2780
2781
// A system error occurred (disk space, database error, ...).
2781
2782
// Make the mempool consistent with the current tip, just in case
2782
2783
// any observers try to use it before shutdown.
2783
- UpdateMempoolForReorg (:: ChainstateActive () , m_mempool, disconnectpool, false );
2784
+ UpdateMempoolForReorg (* this , m_mempool, disconnectpool, false );
2784
2785
return false ;
2785
2786
}
2786
2787
} else {
@@ -2797,7 +2798,7 @@ bool CChainState::ActivateBestChainStep(BlockValidationState& state, const CChai
2797
2798
if (fBlocksDisconnected ) {
2798
2799
// If any blocks were disconnected, disconnectpool may be non empty. Add
2799
2800
// any disconnected transactions back to the mempool.
2800
- UpdateMempoolForReorg (:: ChainstateActive () , m_mempool, disconnectpool, true );
2801
+ UpdateMempoolForReorg (* this , m_mempool, disconnectpool, true );
2801
2802
}
2802
2803
m_mempool.check (*this );
2803
2804
0 commit comments