rpc: use anti-fee-sniping in send, sendall and walletcreatefundedpsbt #32892

pull Sjors wants to merge 5 commits into bitcoin:master from Sjors:2025/07/locktime changing 8 files +94 −27
  1. Sjors commented at 2:55 pm on July 7, 2025: member

    If the user does not specify locktime for send, sendall and walletcreatefundedpsbt, enable anti-fee-sniping. Previously we would set nLockTime to 0.

    This behavior matches the sendtoaddress RPC and the GUI wallet.

    Because sendall doesn’t use CreateTransactionInternal this PR refactors (and renames) DiscourageFeeSniping so that it checks input nSequence values and nLockTime by itself, and brings its own FastRandomContext. A subsequent commit then calls this from the sendall RPC.

  2. DrahtBot added the label RPC/REST/ZMQ on Jul 7, 2025
  3. DrahtBot commented at 2:55 pm on July 7, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32892.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #32857 (wallet: allow skipping script paths by Sjors)
    • #31936 (rpc: Support v3 raw transactions creation by Bue-von-hon)
    • #28944 (wallet, rpc: add anti-fee-sniping to send and sendall by ishaanam)
    • #21283 (Implement BIP 370 PSBTv2 by achow101)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. rpc: use anti-fee-sniping in send and walletcreatepsbt
    If the user does not specify 'locktime' for send and
    walletcreatefundedpsbt, enable anti-fee-sniping. This matches
    sendtoaddress RPC behavior and the GUI wallet.
    d1f1866c12
  5. test: check anti fee sniping for send RPC c8a73f3c47
  6. refactor: extract MaybeDiscourageFeeSniping helper
    Rename and refactor DiscourageFeeSniping such that it can determine
    by itself whether to apply anti fee sniping. This makes it easier
    to use outside of CreateTransactionInternal.
    642e4b6f37
  7. rpc: use anti-fee-sniping in sendall 4bc0858202
  8. doc: add release notes 113ba10627
  9. Sjors force-pushed on Jul 7, 2025
  10. Sjors commented at 4:56 pm on July 7, 2025: member
    Expanded the existing test_anti_fee_sniping case in wallet_create_tx.py to cover send sendall. Making sendall actually work required an additional refactor.
  11. Sjors renamed this:
    rpc: use anti-fee-sniping by default
    rpc: use anti-fee-sniping in send, sendall and walletcreatefundedpsbt
    on Jul 7, 2025
  12. glozow commented at 8:26 pm on July 7, 2025: member
    Any chance this is a duplicate of #28944?

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-07-07 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me