aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2017-01-11 11:25:18 -0500
committerAlex Morcos <morcos@chaincode.com>2017-01-20 15:04:16 -0500
commitde1ae324bf3fb7451c1008a1a9721ff9f469533b (patch)
treefe43e0852e270023a86948449d7322b3518f4545 /src/validation.cpp
parente2e624d9ce54d5d0f1fc0b1934c798804d7d7cff (diff)
downloadbitcoin-de1ae324bf3fb7451c1008a1a9721ff9f469533b.tar.xz
Exclude RBF txs from fee estimation
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 109a71fe74..f0b35324e8 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -793,7 +793,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;
@@ -954,10 +955,11 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
}
pool.RemoveStaged(allConflicting, false);
- // 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);