Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 2165dc1

Browse files
committed
Only publish to your bucket
1 parent aa6cea3 commit 2165dc1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dht/network.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ def refreshTable(self):
9393
ds.append(spider.find())
9494

9595
def republishKeys(_):
96-
for bucket in self.protocol.router.buckets:
97-
for node in bucket.nodes.values():
98-
self.protocol.transferKeyValues(node)
96+
self.log.debug("Republishing key/values...")
97+
neighbors = self.protocol.router.findNeighbors(self.node, exclude=self.node)
98+
for node in neighbors:
99+
self.protocol.transferKeyValues(node)
99100

100101
return defer.gatherResults(ds).addCallback(republishKeys)
101102

0 commit comments

Comments
 (0)