Skip to content

Commit bf64c3c

Browse files
committed
Ignore transactions added to mempool during a reorg for fee estimation purposes.
1 parent 04f78ab commit bf64c3c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/validation.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -857,11 +857,12 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
857857
}
858858
pool.RemoveStaged(allConflicting, false, MemPoolRemovalReason::REPLACED);
859859

860-
// This transaction should only count for fee estimation if it isn't a
861-
// BIP 125 replacement transaction (may not be widely supported), the
862-
// node is not behind, and the transaction is not dependent on any other
863-
// transactions in the mempool.
864-
bool validForFeeEstimation = !fReplacementTransaction && IsCurrentForFeeEstimation() && pool.HasNoInputsOf(tx);
860+
// This transaction should only count for fee estimation if:
861+
// - it isn't a BIP 125 replacement transaction (may not be widely supported)
862+
// - it's not being readded during a reorg which bypasses typical mempool fee limits
863+
// - the node is not behind
864+
// - the transaction is not dependent on any other transactions in the mempool
865+
bool validForFeeEstimation = !fReplacementTransaction && !bypass_limits && IsCurrentForFeeEstimation() && pool.HasNoInputsOf(tx);
865866

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

0 commit comments

Comments
 (0)