wallet: fix crash in coin selection with enormous unconfirmed clusters #34962

pull cprkrn wants to merge 2 commits into bitcoin:master from cprkrn:test-feebumper-enormous-cluster changing 2 files +107 −3
  1. cprkrn commented at 3:57 am on March 31, 2026: none

    calculateIndividualBumpFees returns an empty map when GatherClusters aggregates >500 txs across input clusters. FetchSelectedInputs and AvailableCoins then crash on map_of_bump_fees.at().

    Fix:

    • FetchSelectedInputs: return a descriptive error when pre-selected inputs span enormous clusters
    • AvailableCoins: drop unconfirmed outputs and fall back to confirmed inputs

    Same class of bug fixed in #34870 for calculateCombinedBumpFee, but in the coin selection path. Also addresses #29711 (wallet crash with >500 unconfirmed txs).

  2. test: add functional test for bumpfee with enormous unconfirmed clusters
    Add test coverage for the CheckFeeRate() error path where
    calculateCombinedBumpFee() returns nullopt due to GatherClusters()
    finding >500 total transactions across input clusters.
    
    The test creates 9 independent unconfirmed chains (57 txs each, under
    the 64-tx cluster limit), has the wallet spend from all of them (which
    fails to broadcast but stays in the wallet), then verifies bumpfee
    returns the expected error.
    
    Closes #34902
    e991d5be3e
  3. DrahtBot added the label Wallet on Mar 31, 2026
  4. DrahtBot commented at 3:57 am on March 31, 2026: contributor

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

    Reviews

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

  5. cprkrn commented at 4:00 am on March 31, 2026: none
    @furszy this is the same issue you fixed in #34870 but in the coin selection path (FetchSelectedInputs/AvailableCoins). Found it while writing a functional test for #34902.
  6. cprkrn force-pushed on Mar 31, 2026
  7. wallet: fix crash in coin selection when clusters exceed GatherClusters limit
    calculateIndividualBumpFees returns an empty map when MiniMiner can't
    calculate (m_ready_to_calculate is false due to GatherClusters finding
    >500 txs). FetchSelectedInputs and AvailableCoins then crash on
    map_of_bump_fees.at() with an unhandled key-not-found exception.
    
    FetchSelectedInputs: return a descriptive error when the map is empty.
    AvailableCoins: drop unconfirmed outputs and fall back to confirmed
    inputs, so the wallet can still create transactions.
    
    Same class of bug fixed for calculateCombinedBumpFee in #34870.
    
    Refs #34902, #29711
    c6198f4bda
  8. cprkrn force-pushed on Mar 31, 2026


cprkrn DrahtBot

Labels
Wallet


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-03-31 12:13 UTC

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