@@ -538,8 +538,8 @@ static bool IsCurrentForFeeEstimation()
538538}
539539
540540bool AcceptToMemoryPoolWorker (CTxMemPool& pool, CValidationState& state, const CTransactionRef& ptx, bool fLimitFree ,
541- bool * pfMissingInputs, int64_t nAcceptTime, bool fOverrideMempoolLimit , const CAmount& nAbsurdFee ,
542- std::vector<uint256>& vHashTxnToUncache)
541+ bool * pfMissingInputs, int64_t nAcceptTime, std::list<CTransactionRef>* plTxnReplaced ,
542+ bool fOverrideMempoolLimit , const CAmount& nAbsurdFee, std::vector<uint256>& vHashTxnToUncache)
543543{
544544 const CTransaction& tx = *ptx;
545545 const uint256 hash = tx.GetHash ();
@@ -950,6 +950,8 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
950950 hash.ToString (),
951951 FormatMoney (nModifiedFees - nConflictingFees),
952952 (int )nSize - (int )nConflictingSize);
953+ if (plTxnReplaced)
954+ plTxnReplaced->push_back (it->GetSharedTx ());
953955 }
954956 pool.RemoveStaged (allConflicting, false );
955957
@@ -975,10 +977,11 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
975977}
976978
977979bool AcceptToMemoryPoolWithTime (CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree ,
978- bool * pfMissingInputs, int64_t nAcceptTime, bool fOverrideMempoolLimit , const CAmount nAbsurdFee)
980+ bool * pfMissingInputs, int64_t nAcceptTime, std::list<CTransactionRef>* plTxnReplaced,
981+ bool fOverrideMempoolLimit , const CAmount nAbsurdFee)
979982{
980983 std::vector<uint256> vHashTxToUncache;
981- bool res = AcceptToMemoryPoolWorker (pool, state, tx, fLimitFree , pfMissingInputs, nAcceptTime, fOverrideMempoolLimit , nAbsurdFee, vHashTxToUncache);
984+ bool res = AcceptToMemoryPoolWorker (pool, state, tx, fLimitFree , pfMissingInputs, nAcceptTime, plTxnReplaced, fOverrideMempoolLimit , nAbsurdFee, vHashTxToUncache);
982985 if (!res) {
983986 BOOST_FOREACH (const uint256& hashTx, vHashTxToUncache)
984987 pcoinsTip->Uncache (hashTx);
@@ -990,9 +993,10 @@ bool AcceptToMemoryPoolWithTime(CTxMemPool& pool, CValidationState &state, const
990993}
991994
992995bool AcceptToMemoryPool (CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree ,
993- bool * pfMissingInputs, bool fOverrideMempoolLimit , const CAmount nAbsurdFee)
996+ bool * pfMissingInputs, std::list<CTransactionRef>* plTxnReplaced,
997+ bool fOverrideMempoolLimit , const CAmount nAbsurdFee)
994998{
995- return AcceptToMemoryPoolWithTime (pool, state, tx, fLimitFree , pfMissingInputs, GetTime (), fOverrideMempoolLimit , nAbsurdFee);
999+ return AcceptToMemoryPoolWithTime (pool, state, tx, fLimitFree , pfMissingInputs, GetTime (), plTxnReplaced, fOverrideMempoolLimit , nAbsurdFee);
9961000}
9971001
9981002/* * Return transaction in txOut, and if it was found inside a block, its hash is placed in hashBlock */
@@ -2138,7 +2142,7 @@ bool static DisconnectTip(CValidationState& state, const CChainParams& chainpara
21382142 const CTransaction& tx = *it;
21392143 // ignore validation errors in resurrected transactions
21402144 CValidationState stateDummy;
2141- if (tx.IsCoinBase () || !AcceptToMemoryPool (mempool, stateDummy, it, false , NULL , true )) {
2145+ if (tx.IsCoinBase () || !AcceptToMemoryPool (mempool, stateDummy, it, false , NULL , NULL , true )) {
21422146 mempool.removeRecursive (tx);
21432147 } else if (mempool.exists (tx.GetHash ())) {
21442148 vHashUpdate.push_back (tx.GetHash ());
0 commit comments