mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-04-17 23:24:39 +00:00
les: add bootstrap nodes as initial discoveries (#20688)
This commit is contained in:
parent
05ccbb5edd
commit
dae3aee5ff
1 changed files with 13 additions and 0 deletions
|
|
@ -179,6 +179,19 @@ func (pool *serverPool) start(server *p2p.Server, topic discv5.Topic) {
|
||||||
pool.checkDial()
|
pool.checkDial()
|
||||||
pool.wg.Add(1)
|
pool.wg.Add(1)
|
||||||
go pool.eventLoop()
|
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() {
|
func (pool *serverPool) stop() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue