Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
2color authored and MarcoPolo committed Aug 28, 2024
1 parent 2042103 commit 317c8af
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions p2p/protocol/holepunch/svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ func (s *Service) watchForPublicAddr() {
t := time.NewTimer(duration)
defer t.Stop()
for {

// Use both host and observed to enable hole punching for undialable public ips that might not be observed
if len(s.getPublicAddrs()) > 0 {
log.Debug("Host now has a public address. Starting holepunch protocol.")
s.host.SetStreamHandler(Protocol, s.handleNewStream)
Expand Down Expand Up @@ -174,9 +172,7 @@ func (s *Service) incomingHolePunch(str network.Stream) (rtt time.Duration, remo
if !isRelayAddress(str.Conn().RemoteMultiaddr()) {
return 0, nil, nil, fmt.Errorf("received hole punch stream: %s", str.Conn().RemoteMultiaddr())
}

ownAddrs = s.getPublicAddrs()

if s.filter != nil {
ownAddrs = s.filter.FilterLocal(str.Conn().RemotePeer(), ownAddrs)
}
Expand Down

0 comments on commit 317c8af

Please sign in to comment.