interfaces: `findAncestorByHash` returns true for an unknown descendant #36472

issue enirox001 opened this issue on October 8, 2026
  1. enirox001 commented at 12:09 PM on October 8, 2026: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    While testing an external python capnp ipc client on regtest, I found that findAncestorByHash returns success for an unknown descendant hash when the ancestor is known. I also reproduced this directly on master.

    Expected behaviour

    findAncestorByHash should return false when the descendant hash is unknown

    Steps to reproduce

    Add this to the existing findAncestorByHash test in src/test/interfaces_tests.cpp to reproduce the issue

    BOOST_CHECK(!chain->findAncestorByHash(uint256{}, active[0]->GetBlockHash()));
    

    and then running

    cmake --build build --target test_bitcoin -j8 && ./build/bin/test_bitcoin --run_test=interfaces_tests/findAncestorByHash
    

    Relevant log output

    test/interfaces_tests.cpp:97: error: in "interfaces_tests/findAncestorByHash": check !chain->findAncestorByHash(uint256{}, active[0]->GetBlockHash()) has failed
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    v31.1

    Operating system and version

    MacOS 27.0.1 arm

    Machine specifications

    No response

  2. fanquake commented at 9:24 PM on October 8, 2026: member
  3. psychemist commented at 9:11 AM on October 10, 2026: none

    i followed this steps above to reproduce this issue:

    • added the failing findAncestorByHash test to src/test/interfaces_tests.cpp
    • rebuilt Core v32.99.0-d4b0e1e4b078 on my machine (macOS 15.8.01)
    • ran that specific test and got this result:

    <img width="799" height="122" alt="Image" src="https://github.com/user-attachments/assets/d7bbaf57-cc50-45d3-94ba-4a9b8ce1fc22" />


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-11 09:51 UTC

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