|
@ -152,6 +152,7 @@ func (s *Swarm) AddAddrFilter(f string) error { |
|
|
s.Filters.AddDialFilter(m) |
|
|
s.Filters.AddDialFilter(m) |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func filterAddrs(listenAddrs []ma.Multiaddr) ([]ma.Multiaddr, error) { |
|
|
func filterAddrs(listenAddrs []ma.Multiaddr) ([]ma.Multiaddr, error) { |
|
|
if len(listenAddrs) > 0 { |
|
|
if len(listenAddrs) > 0 { |
|
|
filtered := addrutil.FilterUsableAddrs(listenAddrs) |
|
|
filtered := addrutil.FilterUsableAddrs(listenAddrs) |
|
@ -285,6 +286,10 @@ func (s *Swarm) LocalPeer() peer.ID { |
|
|
return s.local |
|
|
return s.local |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (s *Swarm) Backoff() *dialbackoff { |
|
|
|
|
|
return &s.backf |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// notifyAll sends a signal to all Notifiees
|
|
|
// notifyAll sends a signal to all Notifiees
|
|
|
func (s *Swarm) notifyAll(notify func(inet.Notifiee)) { |
|
|
func (s *Swarm) notifyAll(notify func(inet.Notifiee)) { |
|
|
s.notifmu.RLock() |
|
|
s.notifmu.RLock() |
|
|