Skip to content

Commit d4e0b6a

Browse files
marten-seemannMarcoPolo
authored andcommitted
swarm: send notifications synchronously (#1562)
1 parent c4ef41f commit d4e0b6a

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

p2p/net/swarm/swarm.go

+1-9
Original file line numberDiff line numberDiff line change
@@ -541,18 +541,10 @@ func (s *Swarm) Backoff() *DialBackoff {
541541

542542
// notifyAll sends a signal to all Notifiees
543543
func (s *Swarm) notifyAll(notify func(network.Notifiee)) {
544-
var wg sync.WaitGroup
545-
546544
s.notifs.RLock()
547-
wg.Add(len(s.notifs.m))
548545
for f := range s.notifs.m {
549-
go func(f network.Notifiee) {
550-
defer wg.Done()
551-
notify(f)
552-
}(f)
546+
notify(f)
553547
}
554-
555-
wg.Wait()
556548
s.notifs.RUnlock()
557549
}
558550

0 commit comments

Comments
 (0)