fix empty buckets in routing_table_get
This commit is contained in:
parent
9bb91b126d
commit
b0718d295e
1 changed files with 2 additions and 1 deletions
|
@ -3114,6 +3114,7 @@ class Daemon(AuthJSONRPCServer):
|
|||
result['buckets'] = {}
|
||||
|
||||
for i in range(len(self.dht_node._routingTable._buckets)):
|
||||
result['buckets'][i] = []
|
||||
for contact in self.dht_node._routingTable._buckets[i]._contacts:
|
||||
blobs = list(hosts.pop(contact)) if contact in hosts else []
|
||||
blob_hashes.update(blobs)
|
||||
|
@ -3123,7 +3124,7 @@ class Daemon(AuthJSONRPCServer):
|
|||
"node_id": hexlify(contact.id).decode(),
|
||||
"blobs": blobs,
|
||||
}
|
||||
result['buckets'].setdefault(i, []).append(host)
|
||||
result['buckets'][i].append(host)
|
||||
contact_set.add(hexlify(contact.id).decode())
|
||||
|
||||
result['contacts'] = list(contact_set)
|
||||
|
|
Loading…
Reference in a new issue