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