mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-24 12:27:17 +00:00
les: add missing nil check and handle quit in findServers
This commit is contained in:
parent
09baeec0da
commit
323c2d6775
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user