Skip to content

Commit

Permalink
feat(holepunch): add logging when DirectConnect execution fails
Browse files Browse the repository at this point in the history
  • Loading branch information
wlynxg committed Jan 21, 2025
1 parent 2a580cf commit d172a6e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions p2p/protocol/holepunch/holepuncher.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,8 @@ func (hp *holePuncher) initiateHolePunch(rp peer.ID) ([]ma.Multiaddr, []ma.Multi

addr, obsAddr, rtt, err := hp.initiateHolePunchImpl(str)
if err != nil {
log.Debugf("%s", err)
str.Reset()
return addr, obsAddr, rtt, err
return addr, obsAddr, rtt, fmt.Errorf("failed to initiateHolePunch: %w", err)
}
return addr, obsAddr, rtt, err
}
Expand Down Expand Up @@ -278,7 +277,10 @@ func (nn *netNotifiee) Connected(_ network.Network, conn network.Conn) {
return
}

_ = hs.DirectConnect(conn.RemotePeer())
err := hs.DirectConnect(conn.RemotePeer())
if err != nil {
log.Debugf("attempt to perform DirectConnect to %s failed: %s", conn.RemotePeer(), err)
}
}()
}
}
Expand Down

0 comments on commit d172a6e

Please sign in to comment.