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 3 files +56 −24
  1. 8144225309 commented at 4:38 am on January 21, 2026: none

    Skip the APS coin selection pass when the initial selection contains no partial spend—APS cannot improve privacy in this case.

    Detection compares selected vs available UTXO counts per scriptPubKey, reusing available_coins. Test updated to create an actual partial spend scenario.

    Fixes #25150

  2. wallet: skip APS when no partial spend exists
    Compute has_partial_spend inside CreateTransactionInternal using the
    available_coins that are already fetched for coin selection. This avoids
    a redundant AvailableCoins call compared to checking after the fact.
    
    The check determines if the selection spends some but not all UTXOs from
    any scriptPubKey. If no partial spend exists, APS cannot improve privacy,
    so we skip the second coin selection attempt entirely.
    
    Benefits:
    - Avoids unnecessary double coin selection when APS provides no benefit
    - Eliminates misleading tracepoint data
    - Prevents potential disimprovement of selection results
    - No extra AvailableCoins call (uses existing data)
    
    Add has_partial_spend field to CreatedTransactionResult to communicate
    this information from CreateTransactionInternal to CreateTransaction.
    
    Update interface_usdt_coinselection test to set up partial spend scenarios
    so APS tracepoints fire as expected.
    
    Fixes #25150
    b09ffd1563
  3. DrahtBot added the label Wallet on Jan 21, 2026
  4. 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.


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-01-22 09:13 UTC

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