From cd96dbcd9d009ff823e72862a5000f0f7184e4f0 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 17 Sep 2015 12:54:03 +1000 Subject: [PATCH] Tidy --- client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 5caaf76a..3b36a19d 100644 --- a/client.go +++ b/client.go @@ -714,6 +714,7 @@ func reducedDialTimeout(max time.Duration, halfOpenLimit int, pendingPeers int) return } +// Returns whether an address is known to connect to a client with our own ID. func (me *Client) dopplegangerAddr(addr string) bool { _, ok := me.dopplegangerAddrs[addr] return ok @@ -1838,7 +1839,10 @@ func (me *Client) openNewConns(t *torrent) { func (me *Client) addPeers(t *torrent, peers []Peer) { for _, p := range peers { - if me.dopplegangerAddr(net.JoinHostPort(p.IP.String(), strconv.FormatInt(int64(p.Port), 10))) { + if me.dopplegangerAddr(net.JoinHostPort( + p.IP.String(), + strconv.FormatInt(int64(p.Port), 10), + )) { continue } if me.ipBlockRange(p.IP) != nil { -- 2.48.1