Skip to content

Commit 0b043b5

Browse files
swarm: send notifications synchronously
1 parent f3195e9 commit 0b043b5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

p2p/net/swarm/swarm.go

+1-11
Original file line numberDiff line numberDiff line change
@@ -541,19 +541,9 @@ 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-
546-
s.notifs.RLock()
547-
wg.Add(len(s.notifs.m))
548544
for f := range s.notifs.m {
549-
go func(f network.Notifiee) {
550-
defer wg.Done()
551-
notify(f)
552-
}(f)
545+
notify(f)
553546
}
554-
555-
wg.Wait()
556-
s.notifs.RUnlock()
557547
}
558548

559549
// Notify signs up Notifiee to receive signals when events happen

0 commit comments

Comments
 (0)