File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -606,6 +606,15 @@ def test_getblocktxn_handler(self, test_node):
606
606
assert_equal (test_node .last_message ["block" ].block .sha256 , int (block_hash , 16 ))
607
607
assert "blocktxn" not in test_node .last_message
608
608
609
+ # Request with out-of-bounds tx index results in disconnect
610
+ bad_peer = self .nodes [0 ].add_p2p_connection (TestP2PConn ())
611
+ block_hash = node .getblockhash (chain_height )
612
+ block = from_hex (CBlock (), node .getblock (block_hash , False ))
613
+ msg .block_txn_request = BlockTransactionsRequest (int (block_hash , 16 ), [len (block .vtx )])
614
+ with node .assert_debug_log (['getblocktxn with out-of-bounds tx indices' ]):
615
+ bad_peer .send_message (msg )
616
+ bad_peer .wait_for_disconnect ()
617
+
609
618
def test_compactblocks_not_at_tip (self , test_node ):
610
619
node = self .nodes [0 ]
611
620
# Test that requesting old compactblocks doesn't work.
You can’t perform that action at this time.
0 commit comments