client.go | 2 +- diff --git a/client.go b/client.go index 0c9ff2e5e49c27f333d4983f0e3915fbba81ab36..3979b3967195315d4204adfaf2b3d425832268c0 100644 --- a/client.go +++ b/client.go @@ -409,6 +409,7 @@ if t.addrActive(addr) { duplicateConnsAvoided.Add(1) return } + dialTimeout := reducedDialTimeout(dialTimeout, me.halfOpenLimit, len(t.Peers)) t.HalfOpen[addr] = struct{}{} go func() { // Binding to the listen address and dialing via net.Dialer gives @@ -416,7 +417,6 @@ // "address in use" error. It seems it's not possible to dial out from // this address so that peers associate our local address with our // listen address. - dialTimeout := reducedDialTimeout(dialTimeout, me.halfOpenLimit, len(t.Peers)) // Initiate connections via TCP and UTP simultaneously. Use the first // one that succeeds. left := 2