test: add getblockfilter test coverage for header-only blocks #36613

pull aaron-leeb wants to merge 1 commits into bitcoin:master from aaron-leeb:test/getblockfilter-header-only changing 1 files +15 −0
  1. aaron-leeb commented at 5:34 PM on October 22, 2026: none

    Add functional coverage for the getblockfilter error raised when a node has a known block header, but the block has never been connected.

    This gap in test coverage was identified by a coverage report generated while exploring BIP 157/158. The branch in src/rpc/blockchain.cpp was never executed in the measured tests: https://github.com/bitcoin/bitcoin/blob/64cf455b481d36182957bdcfcae7c411a7879897/src/rpc/blockchain.cpp#L3054-L3056

    The existing getblockfilter functional test checks unknown block hashes and filter retrieval for active and stale blocks, but doesn’t check a known header whose block has never been connected.

    This change submits only the block header of a newly mined block to a node using submitheader and verifies that in this expected state, getblockfilter returns error -5 with "Filter not found. Block was not connected to active chain." This adds coverage for the RPC’s distinction between an unknown block and a known block for which no filter has been constructed.

    rpc_getblockfilter.py passes, and changing the error message makes the new assertion fail as expected.

  2. test: add getblockfilter test coverage for header-only blocks 64cf455b48
  3. DrahtBot added the label Tests on Oct 22, 2026
  4. DrahtBot commented at 5:34 PM on October 22, 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. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

Contributors
Labels

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