@@ -68,13 +68,19 @@ def run_test(self):
68
68
assert not peer3 .supports_v2_p2p
69
69
assert_equal (node0 .getpeerinfo ()[- 1 ]["transport_protocol_type" ], "v1" )
70
70
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
+
71
77
self .log .info ("Check outbound connection from v2 TestNode to v2 P2PConnection advertised as v2 is v2" )
72
78
peer5 = node0 .add_outbound_p2p_connection (P2PInterface (), p2p_idx = 2 , supports_v2_p2p = True , advertise_v2_p2p = True )
73
79
assert peer5 .supports_v2_p2p
74
80
assert_equal (node0 .getpeerinfo ()[- 1 ]["transport_protocol_type" ], "v2" )
75
81
76
82
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()
78
84
for peer in node0 .getpeerinfo ():
79
85
assert_greater_than (peer ['bytessent_per_msg' ]['version' ], 0 )
80
86
assert_greater_than (peer ['bytesrecv_per_msg' ]['verack' ], 0 )
@@ -114,7 +120,7 @@ def run_test(self):
114
120
self .disconnect_nodes (0 , 1 )
115
121
116
122
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 )
118
124
119
125
self .log .info ("Check inbound connection to v1 TestNode from v2 P2PConnection is v1" )
120
126
self .restart_node (0 , ["-v2transport=0" ])
0 commit comments