]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Tidy
authorMatt Joiner <anacrolix@gmail.com>
Thu, 17 Sep 2015 02:54:03 +0000 (12:54 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 17 Sep 2015 02:54:03 +0000 (12:54 +1000)
client.go

index 5caaf76a5d2c23a24112cd5711ee14069af8e16a..3b36a19dae892710f17514b5ffc1dc6e3c0dde20 100644 (file)
--- 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 {