diff --git a/p2p/net/swarm/swarm.go b/p2p/net/swarm/swarm.go index 9df1840370..2783416857 100644 --- a/p2p/net/swarm/swarm.go +++ b/p2p/net/swarm/swarm.go @@ -541,19 +541,9 @@ func (s *Swarm) Backoff() *DialBackoff { // notifyAll sends a signal to all Notifiees func (s *Swarm) notifyAll(notify func(network.Notifiee)) { - var wg sync.WaitGroup - - s.notifs.RLock() - wg.Add(len(s.notifs.m)) for f := range s.notifs.m { - go func(f network.Notifiee) { - defer wg.Done() - notify(f) - }(f) + notify(f) } - - wg.Wait() - s.notifs.RUnlock() } // Notify signs up Notifiee to receive signals when events happen