Browse Source

expose backoff manager in swarm

pull/76/head
Jeromy 8 years ago
parent
commit
45f9b5ae0f
  1. 5
      p2p/net/swarm/swarm.go

5
p2p/net/swarm/swarm.go

@ -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()

Loading…
Cancel
Save