let find value run until it finds a value

This commit is contained in:
Victor Shyba 2018-07-03 11:51:39 -03:00
parent 2b0d4c1603
commit 56613a71d5

View file

@ -134,6 +134,9 @@ class _IterativeFind(object):
defer.returnValue(contact.id) defer.returnValue(contact.id)
def should_stop(self): def should_stop(self):
if self.is_find_value_request:
# search stops when it finds a value, let it run
return False
if self.prev_closest_node and self.closest_node and self.distance.is_closer(self.prev_closest_node.id, if self.prev_closest_node and self.closest_node and self.distance.is_closer(self.prev_closest_node.id,
self.closest_node.id): self.closest_node.id):
# we're getting further away # we're getting further away