aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-01-26 10:53:07 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-01-26 10:53:14 +0100
commit9b4d2673b7757fd242b13c972c73897c92a90ce1 (patch)
tree479808926ab380f6c3782920b1e9937d4edbf188 /src
parentfd7021142a7a215c8b2e1b51f7bfe2a612886c7d (diff)
parentde1ae324bf3fb7451c1008a1a9721ff9f469533b (diff)
Merge #9519: Exclude RBF replacement txs from fee estimation
de1ae32 Exclude RBF txs from fee estimation (Alex Morcos)
Diffstat (limited to 'src')
-rw-r--r--src/validation.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index e6bc2288d2..d499d7a0d1 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -827,7 +827,8 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
// subsequent RemoveStaged() and addUnchecked() calls don't guarantee
// mempool consistency for us.
LOCK(pool.cs);
- if (setConflicts.size())
+ const bool fReplacementTransaction = setConflicts.size();
+ if (fReplacementTransaction)
{
CFeeRate newFeeRate(nModifiedFees, nSize);
set<uint256> setConflictsParents;
@@ -991,10 +992,11 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
}
pool.RemoveStaged(allConflicting, false, MemPoolRemovalReason::REPLACED);
- // This transaction should only count for fee estimation if
- // the node is not behind and it is not dependent on any other
- // transactions in the mempool
- bool validForFeeEstimation = IsCurrentForFeeEstimation() && pool.HasNoInputsOf(tx);
+ // This transaction should only count for fee estimation if it isn't a
+ // BIP 125 replacement transaction (may not be widely supported), the
+ // node is not behind, and the transaction is not dependent on any other
+ // transactions in the mempool.
+ bool validForFeeEstimation = !fReplacementTransaction && IsCurrentForFeeEstimation() && pool.HasNoInputsOf(tx);
// Store transaction in memory
pool.addUnchecked(hash, entry, setAncestors, validForFeeEstimation);