client.go | 4 +++- torrent.go | 2 +- diff --git a/client.go b/client.go index e641ffab74588b9c7d767f5648e2f0588bd5b14c..bc9bafbbd8fd95b065ebd03bc154426729fc37e9 100644 --- a/client.go +++ b/client.go @@ -771,7 +771,9 @@ cl.lock() if !opts.receivedHolepunchConnect { g.MakeMapIfNilAndSet(&cl.undialableWithoutHolepunch, holepunchAddr, struct{}{}) } - opts.t.startHolepunchRendezvous(holepunchAddr) + if !opts.skipHolepunchRendezvous { + opts.t.trySendHolepunchRendezvous(holepunchAddr) + } cl.unlock() } err = fmt.Errorf("all initial dials failed") diff --git a/torrent.go b/torrent.go index ad89b45391cc9df92616888a369c67b09245b0e2..49ae06054d4b362c87f892652f15e9c1e0a7bed4 100644 --- a/torrent.go +++ b/torrent.go @@ -2825,7 +2825,7 @@ return fmt.Errorf("unhandled msg type %v", msg.MsgType) } } -func (t *Torrent) startHolepunchRendezvous(addrPort netip.AddrPort) error { +func (t *Torrent) trySendHolepunchRendezvous(addrPort netip.AddrPort) error { rzsSent := 0 for pc := range t.conns { if !pc.supportsExtension(utHolepunch.ExtensionName) {