diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -27,6 +27,7 @@ class CAutoFile; class CBlockIndex; +class Config; inline double AllowFreeThreshold() { return COIN.GetSatoshis() * 144 / 250; @@ -580,7 +581,7 @@ void removeRecursive( const CTransaction &tx, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN); - void removeForReorg(const CCoinsViewCache *pcoins, + void removeForReorg(const Config &config, const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags); void removeConflicts(const CTransaction &tx); void removeForBlock(const std::vector &vtx, diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -7,7 +7,6 @@ #include "chainparams.h" // for GetConsensus. #include "clientversion.h" -#include "config.h" #include "consensus/consensus.h" #include "consensus/validation.h" #include "policy/fees.h" @@ -561,7 +560,8 @@ RemoveStaged(setAllRemoves, false, reason); } -void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, +void CTxMemPool::removeForReorg(const Config &config, + const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags) { // Remove transactions spending a coinbase which are now immature and // no-longer-final transactions. @@ -573,7 +573,6 @@ LockPoints lp = it->GetLockPoints(); bool validLP = TestLockPointValidity(&lp); - auto &config = GetConfig(); CValidationState state; if (!ContextualCheckTransactionForCurrentBlock(config, tx, state, flags) || diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2741,7 +2741,8 @@ } if (fBlocksDisconnected) { - mempool.removeForReorg(pcoinsTip, chainActive.Tip()->nHeight + 1, + mempool.removeForReorg(config, pcoinsTip, + chainActive.Tip()->nHeight + 1, STANDARD_LOCKTIME_VERIFY_FLAGS); LimitMempoolSize( mempool, GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, @@ -2927,7 +2928,8 @@ // ActivateBestChain considers blocks already in chainActive // unconditionally valid already, so force disconnect away from it. if (!DisconnectTip(config, state)) { - mempool.removeForReorg(pcoinsTip, chainActive.Tip()->nHeight + 1, + mempool.removeForReorg(config, pcoinsTip, + chainActive.Tip()->nHeight + 1, STANDARD_LOCKTIME_VERIFY_FLAGS); return false; } @@ -2951,7 +2953,7 @@ } InvalidChainFound(pindex); - mempool.removeForReorg(pcoinsTip, chainActive.Tip()->nHeight + 1, + mempool.removeForReorg(config, pcoinsTip, chainActive.Tip()->nHeight + 1, STANDARD_LOCKTIME_VERIFY_FLAGS); uiInterface.NotifyBlockTip(IsInitialBlockDownload(), pindex->pprev); return true;