fuzz:wallet: add target for wallet receive #34333

pull b-l-u-e wants to merge 1 commits into bitcoin:master from b-l-u-e:fuzz-wallet-receive-target changing 3 files +275 −1
  1. b-l-u-e commented at 7:38 pm on January 18, 2026: none

    Tracking issue (https://github.com/bitcoin/bitcoin/issues/29901)

    this add fuzz target for wallet receive…

    Also, for block height handling for unknown heights

    Allowing -1 for conflicting_block_height in TxStateBlockConflicted which is a valid state when deserializing old wallet data where block heights weren’t stored. This helps sorting an assertion failure that would occur when GetTxDepthInMainChain() encounters transactions with unknown conflicting block heights.

    discovered that GetTxDepthInMainChain() would crash with assert(conf->conflicting_block_height >= 0) when handling transactions with -1 (unknown height), even though this is used elsewhere in the codebase.

    Code inconsistency here below:

    In src/wallet/transaction.h:94, -1 is used for unknown heights:

    0} else if (data.index == -1) {
    1    return TxStateBlockConflicted{data.block_hash, /*height=*/-1};  
    2}
    

    In src/wallet/wallet.cpp:1320, negative heights are handled

    0// If number of conflict confirms cannot be determined, this means
    1// that the block is still unknown or not yet part of the main chain,
    2// for example when loading the wallet during a reindex. Do nothing in that
    3// case.
    4if (m_last_block_processed_height < 0 || conflicting_height < 0) {
    5    return; 
    6}
    

    But in src/wallet/wallet.cpp:3299, the assertion requires >= 0:

    0} else if (auto* conf = wtx.state<TxStateBlockConflicted>()) {
    1    assert(conf->conflicting_block_height >= 0);  // here it crashes
    2    return -1 * (GetLastBlockHeight() - conf->conflicting_block_height + 1);
    3}
    
  2. DrahtBot added the label Fuzzing on Jan 18, 2026
  3. DrahtBot commented at 7:38 pm on January 18, 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/34333.

    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:

    • #32993 (fuzz: wallet: add target for tx scanning by brunoerg)
    • #27865 (wallet: Track no-longer-spendable TXOs separately 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. fuzz:wallet: add target for wallet receive ee8c24f72e
  5. b-l-u-e force-pushed on Jan 18, 2026

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

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