test: cover gettxspendingprevout error without txospenderindex #36573

pull mercie-ux wants to merge 1 commits into bitcoin:master from mercie-ux:test-gettxspendingprevout-no-index changing 1 files +6 −0
  1. mercie-ux commented at 9:36 AM on October 19, 2026: contributor

    Add functional coverage for the gettxspendingprevout error raised when mempool_only=false, no matching spend is in the mempool, and txospenderindex is unavailable.

    The combined unit and functional coverage report shows this throw in src/rpc/mempool.cpp is never reached: https://github.com/bitcoin/bitcoin/blob/71fa0439278f1d11c9a1aabe67312dcdf1cc8757/src/rpc/mempool.cpp#L1080

    The existing test already queries node2 without the index, but mempool_only defaults to true in that case, so the error is only reachable when mempool_only=false is passed explicitly.

    The test now checks both sides on node2 with mempool_only=false: it succeeds while the spends are still in the mempool, and raises the error once they are mined.

  2. test: cover gettxspendingprevout error without txospenderindex
    When `mempool_only=false` is passed to a node without `txospenderindex`
    and the mempool has no spend for a requested outpoint, the RPC throws
    "Mempool lacks a relevant spend, and txospenderindex is unavailable."
    This path was not covered by any test.
    
    The existing node2 query does not reach it because `mempool_only`
    defaults to `true` when the index is unavailable. Pass it explicitly
    and check both cases: the call succeeds while the spends are still in
    the mempool, and raises the error once they are mined.
    edf0d13ad5
  3. DrahtBot added the label Tests on Oct 19, 2026
  4. DrahtBot commented at 9:36 AM on October 19, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK sedited, Hamza1610, vicjuma

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. sedited approved
  6. sedited commented at 2:43 PM on October 19, 2026: contributor

    ACK edf0d13ad5ff9035ad7a0ff7bc38610edb952b2d

  7. vicjuma commented at 7:25 PM on October 19, 2026: contributor

    ACK edf0d13ad5ff9035ad7a0ff7bc38610edb952b2d

  8. sedited commented at 6:38 AM on October 20, 2026: contributor

    @mercie-ux don't forget to remove the template text from your pull request description!

  9. sedited merged this on Oct 20, 2026
  10. sedited closed this on Oct 20, 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-10-29 06:51 UTC

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