File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ def run_test(self):
29
29
self ._test_getnettotals ()
30
30
self ._test_getnetworkinginfo ()
31
31
self ._test_getaddednodeinfo ()
32
+ self ._test_getpeerinfo ()
32
33
33
34
def _test_connection_count (self ):
34
35
# connect_nodes_bi connects each node to the other
@@ -88,6 +89,12 @@ def _test_getaddednodeinfo(self):
88
89
assert_raises_jsonrpc (- 24 , "Node has not been added" ,
89
90
self .nodes [0 ].getaddednodeinfo , '1.1.1.1' )
90
91
92
+ def _test_getpeerinfo (self ):
93
+ peer_info = [x .getpeerinfo () for x in self .nodes ]
94
+ # check both sides of bidirectional connection between nodes
95
+ # the address bound to on one side will be the source address for the other node
96
+ assert_equal (peer_info [0 ][0 ]['addrbind' ], peer_info [1 ][0 ]['addr' ])
97
+ assert_equal (peer_info [1 ][0 ]['addrbind' ], peer_info [0 ][0 ]['addr' ])
91
98
92
99
if __name__ == '__main__' :
93
100
NetTest ().main ()
You can’t perform that action at this time.
0 commit comments