wallet: skip APS when no partial spend exists #34362

pull 8144225309 wants to merge 1 commits into bitcoin:master from 8144225309:aps-skip-no-partial-spend changing 2890 files +889934 −0
  1. 8144225309 commented at 4:38 am on January 21, 2026: none

    Fixes #25150

    APS (Avoid Partial Spends) runs a second coin selection pass to fully spend UTXOs sharing a scriptPubKey. This currently runs unconditionally, even when the first selection has no partial spend. Running APS unnecessarily wastes computation and can produce a worse result when there was nothing to fix.

    Detect partial spends by comparing selected vs available UTXO counts per scriptPubKey, reusing available_coins. Skip APS if none found.

    Test updated to create partial spend scenarios so tracepoints fire.

  2. DrahtBot added the label Wallet on Jan 21, 2026
  3. DrahtBot commented at 4:38 am on January 21, 2026: 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/34362.

    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:

    • #34075 (fees: Introduce Mempool Based Fee Estimation to reduce overestimation by ismaelsadeeq)

    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.

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • an callback -> a callback [indefinite article incorrect before a consonant sound]
    • then then maybe -> then maybe [duplicate word]
    • “#include <d/file.capnp.proxy-types.h>“i -> “#include <d/file.capnp.proxy-types.h>” [stray “i” character after the quoted include makes the sentence malformed]
    • trying to communicating -> trying to communicate [incorrect verb form]
    • ProxySever -> ProxyServer [typo in class/name]
    • will filled with callbacks -> will be filled with callbacks [missing auxiliary verb “be”]

    2026-01-26 03:42:49

  4. wallet: skip APS when no partial spend exists
    APS runs a second coin selection to fully spend UTXOs sharing a
    scriptPubKey. Currently runs unconditionally, even when the first
    selection has no partial spend and APS cannot help.
    
    Detect partial spends by comparing selected vs available UTXO counts
    per scriptPubKey inside CreateTransactionInternal, reusing available_coins.
    Add has_partial_spend to CreatedTransactionResult. Skip APS if false.
    
    Update interface_usdt_coinselection test to create partial spend scenarios
    so tracepoints fire as expected.
    
    Fixes #25150
    ce5460ced7
  5. 8144225309 closed this on Jan 26, 2026

  6. 8144225309 force-pushed on Jan 26, 2026
  7. 8144225309 commented at 4:37 am on January 26, 2026: none
    This PR was corrupted by a shallow clone force-push. The corrected version is at #34405.

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: 2026-02-11 18:13 UTC

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