fix: start idService and add wg.Done to fnApply

This commit is contained in:
Richard Ramos 2023-11-17 09:23:57 -04:00 committed by richΛrd
parent 89385cfcaf
commit 573a97791e
1 changed files with 2 additions and 0 deletions

View File

@ -426,6 +426,7 @@ func (w *Waku) dnsDiscover(ctx context.Context, enrtreeAddress string, apply fnA
func (w *Waku) addWakuV2Peers(ctx context.Context, cfg *Config) error {
fnApply := func(d dnsdisc.DiscoveredNode, wg *sync.WaitGroup) {
defer wg.Done()
if len(d.PeerInfo.Addrs) != 0 {
go w.identifyAndConnect(ctx, w.settings.LightClient, d.PeerInfo)
}
@ -1159,6 +1160,7 @@ func (w *Waku) Start() error {
if err != nil {
return err
}
idService.Start()
w.identifyService = idService