@@ -793,7 +793,8 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
793
793
// subsequent RemoveStaged() and addUnchecked() calls don't guarantee
794
794
// mempool consistency for us.
795
795
LOCK (pool.cs );
796
- if (setConflicts.size ())
796
+ const bool fReplacementTransaction = setConflicts.size ();
797
+ if (fReplacementTransaction )
797
798
{
798
799
CFeeRate newFeeRate (nModifiedFees, nSize);
799
800
set<uint256> setConflictsParents;
@@ -954,10 +955,11 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
954
955
}
955
956
pool.RemoveStaged (allConflicting, false );
956
957
957
- // This transaction should only count for fee estimation if
958
- // the node is not behind and it is not dependent on any other
959
- // transactions in the mempool
960
- bool validForFeeEstimation = IsCurrentForFeeEstimation () && pool.HasNoInputsOf (tx);
958
+ // This transaction should only count for fee estimation if it isn't a
959
+ // BIP 125 replacement transaction (may not be widely supported), the
960
+ // node is not behind, and the transaction is not dependent on any other
961
+ // transactions in the mempool.
962
+ bool validForFeeEstimation = !fReplacementTransaction && IsCurrentForFeeEstimation () && pool.HasNoInputsOf (tx);
961
963
962
964
// Store transaction in memory
963
965
pool.addUnchecked (hash, entry, setAncestors, validForFeeEstimation);
0 commit comments