only use seeds in iterative bootstrap if no contacts are known yet

This commit is contained in:
Jack Robison 2018-06-06 17:22:36 -04:00
parent 16cb6d8657
commit bc0da5e2d1
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -235,7 +235,7 @@ class Node(MockKademliaHelper):
defer.returnValue(None) defer.returnValue(None)
else: else:
# find the closest peers to us # find the closest peers to us
closest = yield self._iterativeFind(self.node_id, shortlist) 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(force=True)