another distance optimization
This commit is contained in:
parent
0084d4684f
commit
323bccb0ae
1 changed files with 1 additions and 3 deletions
|
@ -267,9 +267,7 @@ class Node(object):
|
|||
|
||||
def requestPeers(contacts):
|
||||
if self.externalIP is not None and len(contacts) >= constants.k:
|
||||
is_closer = (
|
||||
self._routingTable.distance(blob_hash, self.id) <
|
||||
self._routingTable.distance(blob_hash, contacts[-1].id))
|
||||
is_closer = Distance(blob_hash).is_closer(self.id, contacts[-1].id)
|
||||
if is_closer:
|
||||
contacts.pop()
|
||||
self.store(blob_hash, value, self_store=True, originalPublisherID=self.id)
|
||||
|
|
Loading…
Reference in a new issue