aboutsummaryrefslogtreecommitdiffstats
path: root/les
diff options
context:
space:
mode:
Diffstat (limited to 'les')
-rw-r--r--les/handler.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/les/handler.go b/les/handler.go
index 44a0a1661..cf698d79c 100644
--- a/les/handler.go
+++ b/les/handler.go
@@ -236,7 +236,7 @@ func (pm *ProtocolManager) removePeer(id string) {
}
func (pm *ProtocolManager) findServers() {
- if pm.p2pServer == nil {
+ if pm.p2pServer == nil || pm.topicDisc == nil {
return
}
enodes := make(chan string, 100)
@@ -259,7 +259,10 @@ func (pm *ProtocolManager) findServers() {
}
}
}()
- time.Sleep(time.Second * 20)
+ select {
+ case <-time.After(time.Second * 20):
+ case <-pm.quitSync:
+ }
close(stop)
}