From 45f9b5ae0f60c53c893329543765765db694ce48 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sun, 3 Jul 2016 13:28:06 -0700 Subject: [PATCH] expose backoff manager in swarm --- p2p/net/swarm/swarm.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/p2p/net/swarm/swarm.go b/p2p/net/swarm/swarm.go index 100a9826d..15e1ec5e1 100644 --- a/p2p/net/swarm/swarm.go +++ b/p2p/net/swarm/swarm.go @@ -152,6 +152,7 @@ func (s *Swarm) AddAddrFilter(f string) error { s.Filters.AddDialFilter(m) return nil } + func filterAddrs(listenAddrs []ma.Multiaddr) ([]ma.Multiaddr, error) { if len(listenAddrs) > 0 { filtered := addrutil.FilterUsableAddrs(listenAddrs) @@ -285,6 +286,10 @@ func (s *Swarm) LocalPeer() peer.ID { return s.local } +func (s *Swarm) Backoff() *dialbackoff { + return &s.backf +} + // notifyAll sends a signal to all Notifiees func (s *Swarm) notifyAll(notify func(inet.Notifiee)) { s.notifmu.RLock()