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 }