mining: preserve lookup result count without a mempool #36132

pull l0rinc wants to merge 2 commits into bitcoin:master from l0rinc:l0rinc/mining-preserve-lookup-result-count changing 2 files +18 −2
  1. l0rinc commented at 4:11 PM on August 31, 2026: contributor

    Problem: The mining interface returns one nullable transaction for every requested txid or wtxid so callers can match results by position. When its NodeContext has no mempool (not sure that's possible, but there's a condition for it which violates the contract), both lookup methods return an empty vector for every nonempty request and discard that positional mapping, see: https://github.com/bitcoin/bitcoin/blob/7b6f9ba7bad13b0c4169259000f7802854cdda0d/src/interfaces/mining.h#L202-L203

    Fix: Return a vector sized to the request when no mempool is available. Default-initialized null entries match the existing representation for identifiers absent from an available mempool, so callers receive one response position per request in either state.

  2. test: characterize mining lookups without mempool 14a8d963f4
  3. mining: preserve transaction lookup result count
    The mining interface returns one nullable transaction for every requested txid or wtxid so callers can match results by position.
    When a `NodeContext` has no mempool, both lookup methods return an empty vector and discard that positional mapping.
    
    Return a vector sized to the request in this state. Its default-initialized entries represent missing transactions, matching
    the existing result for identifiers absent from an available mempool.
    ac2c6c4ef1
  4. DrahtBot added the label Mining on Aug 31, 2026
  5. DrahtBot commented at 4:11 PM on August 31, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  6. sedited requested review from Sjors on Aug 31, 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-08-31 18:51 UTC

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