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