@@ -827,7 +827,8 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
827
827
// subsequent RemoveStaged() and addUnchecked() calls don't guarantee
828
828
// mempool consistency for us.
829
829
LOCK (pool.cs );
830
- if (setConflicts.size ())
830
+ const bool fReplacementTransaction = setConflicts.size ();
831
+ if (fReplacementTransaction )
831
832
{
832
833
CFeeRate newFeeRate (nModifiedFees, nSize);
833
834
set<uint256> setConflictsParents;
@@ -991,10 +992,11 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
991
992
}
992
993
pool.RemoveStaged (allConflicting, false , MemPoolRemovalReason::REPLACED);
993
994
994
- // This transaction should only count for fee estimation if
995
- // the node is not behind and it is not dependent on any other
996
- // transactions in the mempool
997
- bool validForFeeEstimation = IsCurrentForFeeEstimation () && pool.HasNoInputsOf (tx);
995
+ // This transaction should only count for fee estimation if it isn't a
996
+ // BIP 125 replacement transaction (may not be widely supported), the
997
+ // node is not behind, and the transaction is not dependent on any other
998
+ // transactions in the mempool.
999
+ bool validForFeeEstimation = !fReplacementTransaction && IsCurrentForFeeEstimation () && pool.HasNoInputsOf (tx);
998
1000
999
1001
// Store transaction in memory
1000
1002
pool.addUnchecked (hash, entry, setAncestors, validForFeeEstimation);
0 commit comments