From 2d0539f2b8adfd09b3d68c13b2d5fd57829e1b09 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 3 Jul 2018 13:59:30 +0200 Subject: [PATCH] p2p/discover: add neighbors reply nodes always, not just during init --- p2p/discover/table.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/p2p/discover/table.go b/p2p/discover/table.go index 6d6f00347a..8803daa56e 100644 --- a/p2p/discover/table.go +++ b/p2p/discover/table.go @@ -330,11 +330,10 @@ func (tab *Table) findnode(n *Node, targetID NodeID, reply chan<- []*Node) { tab.db.updateFindFails(n.ID, fails-1) } - // Grab as many nodes as possible if we're in the init phase. - if !tab.isInitDone() { - for _, n := range r { - tab.add(n) - } + // Grab as many nodes as possible. Some of them might not be alive anymore, but we'll + // just remove those again during revalidation. + for _, n := range r { + tab.add(n) } reply <- r }