From 2ab7952bda8d15e91b03f8307839030cbb55614e Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Sun, 6 Aug 2023 19:23:21 +0200 Subject: [PATCH] test: add bip157 coverage for (start height > stop height) disconnect --- test/functional/p2p_blockfilters.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/functional/p2p_blockfilters.py b/test/functional/p2p_blockfilters.py index abe2f574e6e..680fa9c7faf 100755 --- a/test/functional/p2p_blockfilters.py +++ b/test/functional/p2p_blockfilters.py @@ -247,6 +247,14 @@ class CompactFiltersTest(BitcoinTestFramework): stop_hash=123456789, ), "requested invalid block hash" ), + ( + # Request with (start block height > stop block height) results in disconnection. + msg_getcfheaders( + filter_type=FILTER_TYPE_BASIC, + start_height=1000, + stop_hash=int(self.nodes[0].getblockhash(999), 16), + ), "sent invalid getcfilters/getcfheaders with start height 1000 and stop height 999" + ), ] for request, expected_log_msg in requests: peer_0 = self.nodes[0].add_p2p_connection(P2PInterface())