fix kademlia lookup condition

This commit is contained in:
zelig 2015-05-13 15:00:19 +02:00
parent 4a7f5c9899
commit 38fc79129f

View file

@ -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
}