p2p/discover: add neighbors reply nodes always, not just during init

This commit is contained in:
Felix Lange 2018-07-03 13:59:30 +02:00
parent b7172ee02f
commit 2d0539f2b8

View file

@ -330,12 +330,11 @@ func (tab *Table) findnode(n *Node, targetID NodeID, reply chan<- []*Node) {
tab.db.updateFindFails(n.ID, fails-1) tab.db.updateFindFails(n.ID, fails-1)
} }
// Grab as many nodes as possible if we're in the init phase. // Grab as many nodes as possible. Some of them might not be alive anymore, but we'll
if !tab.isInitDone() { // just remove those again during revalidation.
for _, n := range r { for _, n := range r {
tab.add(n) tab.add(n)
} }
}
reply <- r reply <- r
} }