From dae3aee5ff7ebcd24a50937a1d0ae080c2f1d897 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 18 Feb 2020 12:24:05 +0100 Subject: [PATCH] les: add bootstrap nodes as initial discoveries (#20688) --- les/serverpool.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/les/serverpool.go b/les/serverpool.go index 37621dc63..f8fd72169 100644 --- a/les/serverpool.go +++ b/les/serverpool.go @@ -179,6 +179,19 @@ func (pool *serverPool) start(server *p2p.Server, topic discv5.Topic) { pool.checkDial() pool.wg.Add(1) go pool.eventLoop() + + // Inject the bootstrap nodes as initial dial candiates. + pool.wg.Add(1) + go func() { + defer pool.wg.Done() + for _, n := range server.BootstrapNodes { + select { + case pool.discNodes <- n: + case <-pool.closeCh: + return + } + } + }() } func (pool *serverPool) stop() {