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