aboutsummaryrefslogtreecommitdiffstats
path: root/les/serverpool.go
diff options
context:
space:
mode:
authorb00ris <b00ris@mail.ru>2017-11-09 17:43:37 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-11-09 17:43:37 +0800
commit7ace02398160fe4d0f0bf9e7c49ff86e6fdb15bc (patch)
tree24ed77a7b6ca71fa58a273ee92e653061b9fdf32 /les/serverpool.go
parent0914d4e0d2b29249bdec9d2342256c39e1787bf3 (diff)
downloaddexon-7ace02398160fe4d0f0bf9e7c49ff86e6fdb15bc.tar.gz
dexon-7ace02398160fe4d0f0bf9e7c49ff86e6fdb15bc.tar.zst
dexon-7ace02398160fe4d0f0bf9e7c49ff86e6fdb15bc.zip
les: fix channel assignment data race (#15441)
Diffstat (limited to 'les/serverpool.go')
-rw-r--r--les/serverpool.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/les/serverpool.go b/les/serverpool.go
index f4e4df2fb..dc1ea6bf0 100644
--- a/les/serverpool.go
+++ b/les/serverpool.go
@@ -145,15 +145,15 @@ func (pool *serverPool) start(server *p2p.Server, topic discv5.Topic) {
pool.wg.Add(1)
pool.loadNodes()
- go pool.eventLoop()
-
- pool.checkDial()
if pool.server.DiscV5 != nil {
pool.discSetPeriod = make(chan time.Duration, 1)
pool.discNodes = make(chan *discv5.Node, 100)
pool.discLookups = make(chan bool, 100)
go pool.server.DiscV5.SearchTopic(pool.topic, pool.discSetPeriod, pool.discNodes, pool.discLookups)
}
+
+ go pool.eventLoop()
+ pool.checkDial()
}
// connect should be called upon any incoming connection. If the connection has been