@@ -4182,7 +4182,7 @@ bool static LoadBlockIndexDB(ChainstateManager& chainman, const CChainParams& ch
4182
4182
void CChainState::LoadMempool (const ArgsManager& args)
4183
4183
{
4184
4184
if (args.GetArg (" -persistmempool" , DEFAULT_PERSIST_MEMPOOL)) {
4185
- ::LoadMempool (m_mempool);
4185
+ ::LoadMempool (m_mempool, ::ChainstateActive() );
4186
4186
}
4187
4187
m_mempool.SetIsLoaded (!ShutdownRequested ());
4188
4188
}
@@ -5012,7 +5012,7 @@ int VersionBitsTipStateSinceHeight(const Consensus::Params& params, Consensus::D
5012
5012
5013
5013
static const uint64_t MEMPOOL_DUMP_VERSION = 1 ;
5014
5014
5015
- bool LoadMempool (CTxMemPool& pool)
5015
+ bool LoadMempool (CTxMemPool& pool, CChainState& active_chainstate )
5016
5016
{
5017
5017
const CChainParams& chainparams = Params ();
5018
5018
int64_t nExpiryTimeout = gArgs .GetArg (" -mempoolexpiry" , DEFAULT_MEMPOOL_EXPIRY) * 60 * 60 ;
@@ -5052,7 +5052,8 @@ bool LoadMempool(CTxMemPool& pool)
5052
5052
}
5053
5053
if (nTime > nNow - nExpiryTimeout) {
5054
5054
LOCK (cs_main);
5055
- if (AcceptToMemoryPoolWithTime (chainparams, pool, ::ChainstateActive (), tx, nTime, false /* bypass_limits */ ,
5055
+ assert (std::addressof (::ChainstateActive ()) == std::addressof (active_chainstate));
5056
+ if (AcceptToMemoryPoolWithTime (chainparams, pool, active_chainstate, tx, nTime, false /* bypass_limits */ ,
5056
5057
false /* test_accept */ ).m_result_type == MempoolAcceptResult::ResultType::VALID) {
5057
5058
++count;
5058
5059
} else {
0 commit comments