client.go | 10 +++++++++- diff --git a/client.go b/client.go index 1fa9c2bc2950f77840adc708c62c4fd3f901b7de..a1cea721731419895997746325fb7ffe4997d715 100644 --- a/client.go +++ b/client.go @@ -530,7 +530,11 @@ } countDialResult(err) dr := dialResult{c, network} if c == nil { - cte.Done() + if err != nil && forgettableDialError(err) { + cte.Forget() + } else { + cte.Done() + } } else { dr.Conn = closeWrapper{c, func() error { err := c.Close() @@ -565,6 +569,10 @@ if res.Conn != nil { go torrent.Add(fmt.Sprintf("network dialed first: %s", res.Conn.RemoteAddr().Network()), 1) } return res +} + +func forgettableDialError(err error) bool { + return strings.Contains(err.Error(), "no suitable address found") } func (cl *Client) noLongerHalfOpen(t *Torrent, addr string) {