add port to routing_table_get

This commit is contained in:
Jack Robison 2018-05-23 18:26:43 -04:00
parent cc32d987b2
commit bdd6f948ca
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -3137,6 +3137,7 @@ class Daemon(AuthJSONRPCServer):
<bucket index>: [ <bucket index>: [
{ {
"address": (str) peer address, "address": (str) peer address,
"port": (int) peer udp port
"node_id": (str) peer node id, "node_id": (str) peer node id,
"blobs": (list) blob hashes announced by peer "blobs": (list) blob hashes announced by peer
} }
@ -3159,7 +3160,7 @@ class Daemon(AuthJSONRPCServer):
try: try:
contact = self.session.dht_node._routingTable.getContact( contact = self.session.dht_node._routingTable.getContact(
originalPublisherID) originalPublisherID)
except ValueError: except (ValueError, IndexError):
continue continue
if contact in hosts: if contact in hosts:
blobs = hosts[contact] blobs = hosts[contact]
@ -3182,6 +3183,7 @@ class Daemon(AuthJSONRPCServer):
blobs = [] blobs = []
host = { host = {
"address": contact.address, "address": contact.address,
"port": contact.port,
"node_id": contact.id.encode("hex"), "node_id": contact.id.encode("hex"),
"blobs": blobs, "blobs": blobs,
} }