|
|
|
@ -111,15 +111,17 @@ func (s *LesServer) Protocols() []p2p.Protocol { |
|
|
|
|
// Start starts the LES server
|
|
|
|
|
func (s *LesServer) Start(srvr *p2p.Server) { |
|
|
|
|
s.protocolManager.Start(s.config.LightPeers) |
|
|
|
|
for _, topic := range s.lesTopics { |
|
|
|
|
topic := topic |
|
|
|
|
go func() { |
|
|
|
|
logger := log.New("topic", topic) |
|
|
|
|
logger.Info("Starting topic registration") |
|
|
|
|
defer logger.Info("Terminated topic registration") |
|
|
|
|
|
|
|
|
|
srvr.DiscV5.RegisterTopic(topic, s.quitSync) |
|
|
|
|
}() |
|
|
|
|
if srvr.DiscV5 != nil { |
|
|
|
|
for _, topic := range s.lesTopics { |
|
|
|
|
topic := topic |
|
|
|
|
go func() { |
|
|
|
|
logger := log.New("topic", topic) |
|
|
|
|
logger.Info("Starting topic registration") |
|
|
|
|
defer logger.Info("Terminated topic registration") |
|
|
|
|
|
|
|
|
|
srvr.DiscV5.RegisterTopic(topic, s.quitSync) |
|
|
|
|
}() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
s.privateKey = srvr.PrivateKey |
|
|
|
|
s.protocolManager.blockLoop() |
|
|
|
|