@@ -35,7 +35,12 @@ def run_test(self):
35
35
# sync_all() verifies that the block tips match
36
36
self .sync_all (self .nodes [0 :2 ])
37
37
assert_equal (self .nodes [1 ].getblockcount (), 5 )
38
- assert_equal (self .nodes [1 ].getpeerinfo ()[0 ]["transport_protocol_type" ], "v2" )
38
+ peerinfo_0 = self .nodes [0 ].getpeerinfo ()
39
+ peerinfo_1 = self .nodes [1 ].getpeerinfo ()
40
+ assert_equal (peerinfo_0 [0 ]["transport_protocol_type" ], "v2" )
41
+ assert_equal (peerinfo_1 [0 ]["transport_protocol_type" ], "v2" )
42
+ assert_equal (len (peerinfo_0 [0 ]["v2_session_id" ]), 64 )
43
+ assert_equal (peerinfo_0 [0 ]["v2_session_id" ], peerinfo_1 [0 ]["v2_session_id" ])
39
44
40
45
# V1 nodes can sync with each other
41
46
assert_equal (self .nodes [2 ].getblockcount (), 0 )
@@ -49,7 +54,9 @@ def run_test(self):
49
54
self .sync_all (self .nodes [2 :4 ])
50
55
assert_equal (self .nodes [3 ].getblockcount (), 8 )
51
56
assert self .nodes [0 ].getbestblockhash () != self .nodes [2 ].getbestblockhash ()
52
- assert_equal (self .nodes [2 ].getpeerinfo ()[0 ]["transport_protocol_type" ], "v1" )
57
+ peerinfo_2 = self .nodes [2 ].getpeerinfo ()
58
+ assert_equal (peerinfo_2 [0 ]["transport_protocol_type" ], "v1" )
59
+ assert "v2_session_id" not in peerinfo_2 [0 ]
53
60
54
61
# V1 nodes can sync with V2 nodes
55
62
self .disconnect_nodes (0 , 1 )
0 commit comments