Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
251(252# Request with (start block height > stop block height) results in disconnection.253msg_getcfheaders(254filter_type=FILTER_TYPE_BASIC,255start_height=1000,256stop_hash=int(self.nodes[0].getblockhash(999), 16),257), "sent invalid getcfilters/getcfheaders with start height 1000 and stop height 999"258),259]260for request, expected_log_msg in requests:261peer_0 = self.nodes[0].add_p2p_connection(P2PInterface())262with self.nodes[0].assert_debug_log(expected_msgs=[expected_log_msg]):263peer_0.send_without_ping(request)264peer_0.wait_for_disconnect()266self.log.info("Test -peerblockfilters without -blockfilterindex raises an error")267self.stop_node(0)268self.nodes[0].extra_args = ["-peerblockfilters"]269msg = "Error: Cannot set -peerblockfilters without -blockfilterindex."270self.nodes[0].assert_start_raises_init_error(expected_msg=msg)272self.log.info("Test unknown value to -blockfilterindex raises an error")273self.nodes[0].extra_args = ["-blockfilterindex=abc"]274msg = "Error: Unknown -blockfilterindex value abc."275self.nodes[0].assert_start_raises_init_error(expected_msg=msg)277def compute_last_header(prev_header, hashes):278"""Compute the last filter header from a starting header and a sequence of filter hashes."""279header = ser_uint256(prev_header)280for filter_hash in hashes:281header = hash256(ser_uint256(filter_hash) + header)282return uint256_from_str(header)285if __name__ == '__main__':286CompactFiltersTest(__file__).main()
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.