disable forced bucket refresh during join

This commit is contained in:
Jack Robison 2018-06-07 12:16:27 -04:00
parent f3e848b2e2
commit 7f3ead67bf
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -236,10 +236,10 @@ class Node(MockKademliaHelper):
# find the closest peers to us # find the closest peers to us
closest = yield self._iterativeFind(self.node_id, shortlist if not self.contacts else None) closest = yield self._iterativeFind(self.node_id, shortlist if not self.contacts else None)
yield _ping_contacts(closest) yield _ping_contacts(closest)
# query random hashes in our bucket key ranges to fill or split them # # query random hashes in our bucket key ranges to fill or split them
random_ids_in_range = self._routingTable.getRefreshList(force=True) # random_ids_in_range = self._routingTable.getRefreshList()
while random_ids_in_range: # while random_ids_in_range:
yield self.iterativeFindNode(random_ids_in_range.pop()) # yield self.iterativeFindNode(random_ids_in_range.pop())
defer.returnValue(None) defer.returnValue(None)
@defer.inlineCallbacks @defer.inlineCallbacks
@ -252,7 +252,7 @@ class Node(MockKademliaHelper):
if not joined_d.called: if not joined_d.called:
joined_d.callback(True) joined_d.callback(True)
elif buckets_with_contacts < 4: elif buckets_with_contacts < 4:
self.reactor_callLater(1, _iterative_join, joined_d, buckets_with_contacts) self.reactor_callLater(0, _iterative_join, joined_d, buckets_with_contacts)
elif not joined_d.called: elif not joined_d.called:
joined_d.callback(None) joined_d.callback(None)
yield joined_d yield joined_d