Replaces transactions already in the mempool if a new transaction is seen with a higher fee, provided that the replacement transaction’s outputs pay all previous outputs an equal or greater amount. This preserves the “first seen” behavior of the mempool, in the sense that a transaction will never be replaced in a fashion that prevents an address from receiving funds that it otherwise would have. In short, zero-conf transactions are unaffected. (beyond the usual breakage for any mempool behavior change)
To prevent replacements from being used as a DoS attack mechanism a replacement only happens if the new transaction has a higher fee, pays a higher fee/KB rate, and the fee increase is sufficient to pay for the bandwidth consumed in relaying the replacement.
Includes stand-alone unittests for regtest in qa/replace-by-fee/ (implemented w/ python-bitcoinlib as I’ve been asked for a backport of this to v0.10/v0.9)
You can easily try out the behavior using https://github.com/petertodd/replace-by-fee-tools bump-fee.py with the -s first-seen-safe mode switch.
CC: @aalness @coblee re: https://github.com/petertodd/bitcoin/pull/3