From 38fc79129f4682131e2cc219a224c503387dfd54 Mon Sep 17 00:00:00 2001 From: zelig Date: Wed, 13 May 2015 15:00:19 +0200 Subject: [PATCH] fix kademlia lookup condition --- common/kademlia/kademlia.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/kademlia/kademlia.go b/common/kademlia/kademlia.go index 40b83b9f99..c845f25851 100644 --- a/common/kademlia/kademlia.go +++ b/common/kademlia/kademlia.go @@ -267,7 +267,7 @@ func (self *Kademlia) getNodes(target Address, max int) (r nodesByDistance) { r.push(bucket[i], limit) n++ } - if max == 0 && start <= index && n > 0 || + if max == 0 && start <= index && (n > 0 || start == 0) || max > 0 && down && start <= index && (n >= limit || n == self.Count() || start == 0) { break }