@@ -384,7 +384,9 @@ void UpdateMempoolForReorg(DisconnectedBlockTransactions &disconnectpool, bool f
384384 while (it != disconnectpool.queuedTx .get <insertion_order>().rend ()) {
385385 // ignore validation errors in resurrected transactions
386386 CValidationState stateDummy;
387- if (!fAddToMempool || (*it)->IsCoinBase () || !AcceptToMemoryPool (mempool, stateDummy, *it, false , nullptr , nullptr , true )) {
387+ if (!fAddToMempool || (*it)->IsCoinBase () ||
388+ !AcceptToMemoryPool (mempool, stateDummy, *it, nullptr /* pfMissingInputs */ ,
389+ nullptr /* plTxnReplaced */ , true /* bypass_limits */ , 0 /* nAbsurdFee */ )) {
388390 // If the transaction doesn't make it in to the mempool, remove any
389391 // transactions that depend on it (which would now be orphans).
390392 mempool.removeRecursive (**it, MemPoolRemovalReason::REORG);
@@ -443,9 +445,9 @@ static bool CheckInputsFromMempoolAndCache(const CTransaction& tx, CValidationSt
443445 return CheckInputs (tx, state, view, true , flags, cacheSigStore, true , txdata);
444446}
445447
446- static bool AcceptToMemoryPoolWorker (const CChainParams& chainparams, CTxMemPool& pool, CValidationState& state, const CTransactionRef& ptx, bool fLimitFree ,
448+ static bool AcceptToMemoryPoolWorker (const CChainParams& chainparams, CTxMemPool& pool, CValidationState& state, const CTransactionRef& ptx,
447449 bool * pfMissingInputs, int64_t nAcceptTime, std::list<CTransactionRef>* plTxnReplaced,
448- bool fOverrideMempoolLimit , const CAmount& nAbsurdFee, std::vector<COutPoint>& coins_to_uncache)
450+ bool bypass_limits , const CAmount& nAbsurdFee, std::vector<COutPoint>& coins_to_uncache)
449451{
450452 const CTransaction& tx = *ptx;
451453 const uint256 hash = tx.GetHash ();
@@ -623,7 +625,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
623625 }
624626
625627 // No transactions are allowed below minRelayTxFee except from disconnected blocks
626- if (fLimitFree && nModifiedFees < ::minRelayTxFee.GetFee (nSize)) {
628+ if (!bypass_limits && nModifiedFees < ::minRelayTxFee.GetFee (nSize)) {
627629 return state.DoS (0 , false , REJECT_INSUFFICIENTFEE, " min relay fee not met" );
628630 }
629631
@@ -865,7 +867,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
865867 pool.addUnchecked (hash, entry, setAncestors, validForFeeEstimation);
866868
867869 // trim mempool and check if tx was trimmed
868- if (!fOverrideMempoolLimit ) {
870+ if (!bypass_limits ) {
869871 LimitMempoolSize (pool, gArgs .GetArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 , gArgs .GetArg (" -mempoolexpiry" , DEFAULT_MEMPOOL_EXPIRY) * 60 * 60 );
870872 if (!pool.exists (hash))
871873 return state.DoS (0 , false , REJECT_INSUFFICIENTFEE, " mempool full" );
@@ -878,12 +880,12 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
878880}
879881
880882/* * (try to) add transaction to memory pool with a specified acceptance time **/
881- static bool AcceptToMemoryPoolWithTime (const CChainParams& chainparams, CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree ,
883+ static bool AcceptToMemoryPoolWithTime (const CChainParams& chainparams, CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx,
882884 bool * pfMissingInputs, int64_t nAcceptTime, std::list<CTransactionRef>* plTxnReplaced,
883- bool fOverrideMempoolLimit , const CAmount nAbsurdFee)
885+ bool bypass_limits , const CAmount nAbsurdFee)
884886{
885887 std::vector<COutPoint> coins_to_uncache;
886- bool res = AcceptToMemoryPoolWorker (chainparams, pool, state, tx, fLimitFree , pfMissingInputs, nAcceptTime, plTxnReplaced, fOverrideMempoolLimit , nAbsurdFee, coins_to_uncache);
888+ bool res = AcceptToMemoryPoolWorker (chainparams, pool, state, tx, pfMissingInputs, nAcceptTime, plTxnReplaced, bypass_limits , nAbsurdFee, coins_to_uncache);
887889 if (!res) {
888890 for (const COutPoint& hashTx : coins_to_uncache)
889891 pcoinsTip->Uncache (hashTx);
@@ -894,12 +896,12 @@ static bool AcceptToMemoryPoolWithTime(const CChainParams& chainparams, CTxMemPo
894896 return res;
895897}
896898
897- bool AcceptToMemoryPool (CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree ,
899+ bool AcceptToMemoryPool (CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx,
898900 bool * pfMissingInputs, std::list<CTransactionRef>* plTxnReplaced,
899- bool fOverrideMempoolLimit , const CAmount nAbsurdFee)
901+ bool bypass_limits , const CAmount nAbsurdFee)
900902{
901903 const CChainParams& chainparams = Params ();
902- return AcceptToMemoryPoolWithTime (chainparams, pool, state, tx, fLimitFree , pfMissingInputs, GetTime (), plTxnReplaced, fOverrideMempoolLimit , nAbsurdFee);
904+ return AcceptToMemoryPoolWithTime (chainparams, pool, state, tx, pfMissingInputs, GetTime (), plTxnReplaced, bypass_limits , nAbsurdFee);
903905}
904906
905907/* * Return transaction in txOut, and if it was found inside a block, its hash is placed in hashBlock */
@@ -4306,7 +4308,8 @@ bool LoadMempool(void)
43064308 CValidationState state;
43074309 if (nTime + nExpiryTimeout > nNow) {
43084310 LOCK (cs_main);
4309- AcceptToMemoryPoolWithTime (chainparams, mempool, state, tx, true , nullptr , nTime, nullptr , false , 0 );
4311+ AcceptToMemoryPoolWithTime (chainparams, mempool, state, tx, nullptr /* pfMissingInputs */ , nTime,
4312+ nullptr /* plTxnReplaced */ , false /* bypass_limits */ , 0 /* nAbsurdFee */ );
43104313 if (state.IsValid ()) {
43114314 ++count;
43124315 } else {
0 commit comments