[rpc] Add connection type to getpeerinfo RPC, update tests

This commit is contained in:
Amiti Uttarwar
2020-08-12 13:57:13 -07:00
parent 49c10a9ca4
commit 395acfa83a
4 changed files with 19 additions and 0 deletions

View File

@@ -175,6 +175,12 @@ class NetTest(BitcoinTestFramework):
for info in peer_info:
assert_net_servicesnames(int(info[0]["services"], 0x10), info[0]["servicesnames"])
assert_equal(peer_info[0][0]['connection_type'], 'inbound')
assert_equal(peer_info[0][1]['connection_type'], 'manual')
assert_equal(peer_info[1][0]['connection_type'], 'manual')
assert_equal(peer_info[1][1]['connection_type'], 'inbound')
def test_service_flags(self):
self.log.info("Test service flags")
self.nodes[0].add_p2p_connection(P2PInterface(), services=(1 << 4) | (1 << 63))