Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
remove incorrect call to InterceptAddrDial
Browse files Browse the repository at this point in the history
addConn is called both when we add a dialed and an accepted connection to the
swarm. InterceptAddrDial is only supposed to intercept outgoing connections
though. When dialing, we already call InterceptAddrDial when we compose the
list of dialable addresses.
  • Loading branch information
marten-seemann committed May 18, 2021
1 parent b80b91c commit 7531412
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,6 @@ func (s *Swarm) addConn(tc transport.CapableConn, dir network.Direction) (*Conn,
addr = tc.RemoteMultiaddr()
)

if s.gater != nil {
if allow := s.gater.InterceptAddrDial(p, addr); !allow {
err := tc.Close()
if err != nil {
log.Warnf("failed to close connection with peer %s and addr %s; err: %s", p.Pretty(), addr, err)
}
return nil, ErrAddrFiltered
}
}

// create the Stat object, initializing with the underlying connection Stat if available
var stat network.Stat
if cs, ok := tc.(network.ConnStat); ok {
Expand Down

0 comments on commit 7531412

Please sign in to comment.