forked from cerc-io/plugeth
les: fix server panic when discovery disabled (#16055)
This commit is contained in:
parent
a00f4a12a9
commit
2f849ade82
@ -111,6 +111,7 @@ func (s *LesServer) Protocols() []p2p.Protocol {
|
||||
// Start starts the LES server
|
||||
func (s *LesServer) Start(srvr *p2p.Server) {
|
||||
s.protocolManager.Start(s.config.LightPeers)
|
||||
if srvr.DiscV5 != nil {
|
||||
for _, topic := range s.lesTopics {
|
||||
topic := topic
|
||||
go func() {
|
||||
@ -121,6 +122,7 @@ func (s *LesServer) Start(srvr *p2p.Server) {
|
||||
srvr.DiscV5.RegisterTopic(topic, s.quitSync)
|
||||
}()
|
||||
}
|
||||
}
|
||||
s.privateKey = srvr.PrivateKey
|
||||
s.protocolManager.blockLoop()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user