]> Sergey Matveev's repositories - btrtrc.git/blobdiff - client.go
Don't start another holepunch rendezvous if we're handling one
[btrtrc.git] / client.go
index e641ffab74588b9c7d767f5648e2f0588bd5b14c..bc9bafbbd8fd95b065ebd03bc154426729fc37e9 100644 (file)
--- a/client.go
+++ b/client.go
@@ -771,7 +771,9 @@ func (cl *Client) dialAndCompleteHandshake(opts outgoingConnOpts) (c *PeerConn,
                        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")