@@ -384,7 +384,9 @@ void UpdateMempoolForReorg(DisconnectedBlockTransactions &disconnectpool, bool f
384
384
while (it != disconnectpool.queuedTx .get <insertion_order>().rend ()) {
385
385
// ignore validation errors in resurrected transactions
386
386
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 */ )) {
388
390
// If the transaction doesn't make it in to the mempool, remove any
389
391
// transactions that depend on it (which would now be orphans).
390
392
mempool.removeRecursive (**it, MemPoolRemovalReason::REORG);
@@ -443,9 +445,9 @@ static bool CheckInputsFromMempoolAndCache(const CTransaction& tx, CValidationSt
443
445
return CheckInputs (tx, state, view, true , flags, cacheSigStore, true , txdata);
444
446
}
445
447
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,
447
449
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)
449
451
{
450
452
const CTransaction& tx = *ptx;
451
453
const uint256 hash = tx.GetHash ();
@@ -623,7 +625,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
623
625
}
624
626
625
627
// 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)) {
627
629
return state.DoS (0 , false , REJECT_INSUFFICIENTFEE, " min relay fee not met" );
628
630
}
629
631
@@ -865,7 +867,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
865
867
pool.addUnchecked (hash, entry, setAncestors, validForFeeEstimation);
866
868
867
869
// trim mempool and check if tx was trimmed
868
- if (!fOverrideMempoolLimit ) {
870
+ if (!bypass_limits ) {
869
871
LimitMempoolSize (pool, gArgs .GetArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 , gArgs .GetArg (" -mempoolexpiry" , DEFAULT_MEMPOOL_EXPIRY) * 60 * 60 );
870
872
if (!pool.exists (hash))
871
873
return state.DoS (0 , false , REJECT_INSUFFICIENTFEE, " mempool full" );
@@ -878,12 +880,12 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
878
880
}
879
881
880
882
/* * (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,
882
884
bool * pfMissingInputs, int64_t nAcceptTime, std::list<CTransactionRef>* plTxnReplaced,
883
- bool fOverrideMempoolLimit , const CAmount nAbsurdFee)
885
+ bool bypass_limits , const CAmount nAbsurdFee)
884
886
{
885
887
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);
887
889
if (!res) {
888
890
for (const COutPoint& hashTx : coins_to_uncache)
889
891
pcoinsTip->Uncache (hashTx);
@@ -894,12 +896,12 @@ static bool AcceptToMemoryPoolWithTime(const CChainParams& chainparams, CTxMemPo
894
896
return res;
895
897
}
896
898
897
- bool AcceptToMemoryPool (CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree ,
899
+ bool AcceptToMemoryPool (CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx,
898
900
bool * pfMissingInputs, std::list<CTransactionRef>* plTxnReplaced,
899
- bool fOverrideMempoolLimit , const CAmount nAbsurdFee)
901
+ bool bypass_limits , const CAmount nAbsurdFee)
900
902
{
901
903
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);
903
905
}
904
906
905
907
/* * 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)
4306
4308
CValidationState state;
4307
4309
if (nTime + nExpiryTimeout > nNow) {
4308
4310
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 */ );
4310
4313
if (state.IsValid ()) {
4311
4314
++count;
4312
4315
} else {
0 commit comments