From: Matt Joiner Date: Thu, 17 Sep 2015 02:54:03 +0000 (+1000) Subject: Tidy X-Git-Tag: v1.0.0~1040 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=cd96dbcd9d009ff823e72862a5000f0f7184e4f0;p=btrtrc.git Tidy --- 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 {