diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2067,11 +2067,8 @@ pfrom->setAskFor.erase(inv.hash); mapAlreadyAskedFor.erase(inv.hash); - std::list lRemovedTxn; - - if (!AlreadyHave(inv) && - AcceptToMemoryPool(config, mempool, state, ptx, true, - &fMissingInputs, &lRemovedTxn)) { + if (!AlreadyHave(inv) && AcceptToMemoryPool(config, mempool, state, ptx, + true, &fMissingInputs)) { mempool.check(pcoinsTip); RelayTransaction(tx, connman); for (size_t i = 0; i < tx.vout.size(); i++) { @@ -2112,8 +2109,7 @@ continue; } if (AcceptToMemoryPool(config, mempool, stateDummy, - porphanTx, true, &fMissingInputs2, - &lRemovedTxn)) { + porphanTx, true, &fMissingInputs2)) { LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", orphanId.ToString()); RelayTransaction(orphanTx, connman); @@ -2232,10 +2228,6 @@ } } - for (const CTransactionRef &removedTx : lRemovedTxn) { - AddToCompactExtraTransactions(removedTx); - } - int nDoS = 0; if (state.IsInvalid(nDoS)) { LogPrint( diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1142,7 +1142,7 @@ CValidationState state; bool fMissingInputs; if (!AcceptToMemoryPool(config, mempool, state, std::move(tx), - fLimitFree, &fMissingInputs, nullptr, false, + fLimitFree, &fMissingInputs, false, nMaxRawTxFee)) { if (state.IsInvalid()) { throw JSONRPCError(RPC_TRANSACTION_REJECTED, diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp --- a/src/test/txvalidationcache_tests.cpp +++ b/src/test/txvalidationcache_tests.cpp @@ -28,8 +28,8 @@ CValidationState state; return AcceptToMemoryPool(GetConfig(), mempool, state, - MakeTransactionRef(tx), false, nullptr, nullptr, - true, Amount(0)); + MakeTransactionRef(tx), false, nullptr, true, + Amount(0)); } BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup) { diff --git a/src/validation.h b/src/validation.h --- a/src/validation.h +++ b/src/validation.h @@ -365,13 +365,10 @@ /** * (try to) add transaction to memory pool - * plTxnReplaced will be appended to with all transactions replaced from - * mempool. */ bool AcceptToMemoryPool(const Config &config, CTxMemPool &pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree, bool *pfMissingInputs, - std::list *plTxnReplaced = nullptr, bool fOverrideMempoolLimit = false, const Amount nAbsurdFee = Amount(0)); diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -644,7 +644,7 @@ CValidationState stateDummy; if (!fAddToMempool || (*it)->IsCoinBase() || !AcceptToMemoryPool(config, mempool, stateDummy, *it, false, - nullptr, nullptr, true)) { + nullptr, true)) { // If the transaction doesn't make it in to the mempool, remove any // transactions that depend on it (which would now be orphans). mempool.removeRecursive(**it, MemPoolRemovalReason::REORG); @@ -717,8 +717,7 @@ static bool AcceptToMemoryPoolWorker( const Config &config, CTxMemPool &pool, CValidationState &state, const CTransactionRef &ptx, bool fLimitFree, bool *pfMissingInputs, - int64_t nAcceptTime, std::list *plTxnReplaced, - bool fOverrideMempoolLimit, const Amount nAbsurdFee, + int64_t nAcceptTime, bool fOverrideMempoolLimit, const Amount nAbsurdFee, std::vector &coins_to_uncache) { AssertLockHeld(cs_main); @@ -1053,15 +1052,17 @@ /** * (try to) add transaction to memory pool with a specified acceptance time. */ -static bool AcceptToMemoryPoolWithTime( - const Config &config, CTxMemPool &pool, CValidationState &state, - const CTransactionRef &tx, bool fLimitFree, bool *pfMissingInputs, - int64_t nAcceptTime, std::list *plTxnReplaced = nullptr, - bool fOverrideMempoolLimit = false, const Amount nAbsurdFee = Amount(0)) { +static bool AcceptToMemoryPoolWithTime(const Config &config, CTxMemPool &pool, + CValidationState &state, + const CTransactionRef &tx, + bool fLimitFree, bool *pfMissingInputs, + int64_t nAcceptTime, + bool fOverrideMempoolLimit = false, + const Amount nAbsurdFee = Amount(0)) { std::vector coins_to_uncache; bool res = AcceptToMemoryPoolWorker( config, pool, state, tx, fLimitFree, pfMissingInputs, nAcceptTime, - plTxnReplaced, fOverrideMempoolLimit, nAbsurdFee, coins_to_uncache); + fOverrideMempoolLimit, nAbsurdFee, coins_to_uncache); if (!res) { for (const COutPoint &outpoint : coins_to_uncache) { pcoinsTip->Uncache(outpoint); @@ -1078,10 +1079,9 @@ bool AcceptToMemoryPool(const Config &config, CTxMemPool &pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree, bool *pfMissingInputs, - std::list *plTxnReplaced, bool fOverrideMempoolLimit, const Amount nAbsurdFee) { return AcceptToMemoryPoolWithTime(config, pool, state, tx, fLimitFree, - pfMissingInputs, GetTime(), plTxnReplaced, + pfMissingInputs, GetTime(), fOverrideMempoolLimit, nAbsurdFee); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4579,5 +4579,5 @@ bool CMerkleTx::AcceptToMemoryPool(const Amount nAbsurdFee, CValidationState &state) { return ::AcceptToMemoryPool(GetConfig(), mempool, state, tx, true, nullptr, - nullptr, false, nAbsurdFee); + false, nAbsurdFee); }