Skip to content

Commit

Permalink
Ignore transactions added to mempool during a reorg for fee estimatio…
Browse files Browse the repository at this point in the history
…n purposes.
  • Loading branch information
morcos committed Sep 12, 2017
1 parent 04f78ab commit bf64c3c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/validation.cpp
Expand Up @@ -857,11 +857,12 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
}
pool.RemoveStaged(allConflicting, false, MemPoolRemovalReason::REPLACED);

// 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);
// This transaction should only count for fee estimation if:
// - it isn't a BIP 125 replacement transaction (may not be widely supported)
// - it's not being readded during a reorg which bypasses typical mempool fee limits
// - the node is not behind
// - the transaction is not dependent on any other transactions in the mempool
bool validForFeeEstimation = !fReplacementTransaction && !bypass_limits && IsCurrentForFeeEstimation() && pool.HasNoInputsOf(tx);

// Store transaction in memory
pool.addUnchecked(hash, entry, setAncestors, validForFeeEstimation);
Expand Down

0 comments on commit bf64c3c

Please sign in to comment.