@@ -68,13 +68,19 @@ def run_test(self):
6868 assert not peer3 .supports_v2_p2p
6969 assert_equal (node0 .getpeerinfo ()[- 1 ]["transport_protocol_type" ], "v1" )
7070
71+ # v2 TestNode performs downgrading here
72+ self .log .info ("Check outbound connection from v2 TestNode to v1 P2PConnection advertised as v2 is v1" )
73+ peer4 = node0 .add_outbound_p2p_connection (P2PInterface (), p2p_idx = 1 , supports_v2_p2p = False , advertise_v2_p2p = True )
74+ assert not peer4 .supports_v2_p2p
75+ assert_equal (node0 .getpeerinfo ()[- 1 ]["transport_protocol_type" ], "v1" )
76+
7177 self .log .info ("Check outbound connection from v2 TestNode to v2 P2PConnection advertised as v2 is v2" )
7278 peer5 = node0 .add_outbound_p2p_connection (P2PInterface (), p2p_idx = 2 , supports_v2_p2p = True , advertise_v2_p2p = True )
7379 assert peer5 .supports_v2_p2p
7480 assert_equal (node0 .getpeerinfo ()[- 1 ]["transport_protocol_type" ], "v2" )
7581
7682 self .log .info ("Check if version is sent and verack is received in inbound/outbound connections" )
77- assert_equal (len (node0 .getpeerinfo ()), 4 ) # check if above 4 connections are present in node0's getpeerinfo()
83+ assert_equal (len (node0 .getpeerinfo ()), 5 ) # check if above 5 connections are present in node0's getpeerinfo()
7884 for peer in node0 .getpeerinfo ():
7985 assert_greater_than (peer ['bytessent_per_msg' ]['version' ], 0 )
8086 assert_greater_than (peer ['bytesrecv_per_msg' ]['verack' ], 0 )
@@ -114,7 +120,7 @@ def run_test(self):
114120 self .disconnect_nodes (0 , 1 )
115121
116122 self .log .info ("Check the connections opened as expected" )
117- check_node_connections (node = node0 , num_in = 4 , num_out = 2 )
123+ check_node_connections (node = node0 , num_in = 4 , num_out = 3 )
118124
119125 self .log .info ("Check inbound connection to v1 TestNode from v2 P2PConnection is v1" )
120126 self .restart_node (0 , ["-v2transport=0" ])
0 commit comments