@@ -4182,7 +4182,7 @@ bool static LoadBlockIndexDB(ChainstateManager& chainman, const CChainParams& ch
41824182void CChainState::LoadMempool (const ArgsManager& args)
41834183{
41844184 if (args.GetArg (" -persistmempool" , DEFAULT_PERSIST_MEMPOOL)) {
4185- ::LoadMempool (m_mempool);
4185+ ::LoadMempool (m_mempool, ::ChainstateActive() );
41864186 }
41874187 m_mempool.SetIsLoaded (!ShutdownRequested ());
41884188}
@@ -5012,7 +5012,7 @@ int VersionBitsTipStateSinceHeight(const Consensus::Params& params, Consensus::D
50125012
50135013static const uint64_t MEMPOOL_DUMP_VERSION = 1 ;
50145014
5015- bool LoadMempool (CTxMemPool& pool)
5015+ bool LoadMempool (CTxMemPool& pool, CChainState& active_chainstate )
50165016{
50175017 const CChainParams& chainparams = Params ();
50185018 int64_t nExpiryTimeout = gArgs .GetArg (" -mempoolexpiry" , DEFAULT_MEMPOOL_EXPIRY) * 60 * 60 ;
@@ -5052,7 +5052,8 @@ bool LoadMempool(CTxMemPool& pool)
50525052 }
50535053 if (nTime > nNow - nExpiryTimeout) {
50545054 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 */ ,
50565057 false /* test_accept */ ).m_result_type == MempoolAcceptResult::ResultType::VALID) {
50575058 ++count;
50585059 } else {
0 commit comments