]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Rename peer source constants
authorMatt Joiner <anacrolix@gmail.com>
Thu, 17 Oct 2019 06:46:35 +0000 (17:46 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 17 Oct 2019 06:46:35 +0000 (17:46 +1100)
Peer.go
client.go
connection.go
torrent.go

diff --git a/Peer.go b/Peer.go
index 5f63e6ed1afc932d3721011300c30447469d3f02..6a0173300c2cfb2a8b3a5de34bb077699e629a33 100644 (file)
--- a/Peer.go
+++ b/Peer.go
@@ -21,7 +21,7 @@ type Peer struct {
 func (me *Peer) FromPex(na krpc.NodeAddr, fs peer_protocol.PexPeerFlags) {
        me.IP = append([]byte(nil), na.IP...)
        me.Port = na.Port
-       me.Source = peerSourcePEX
+       me.Source = peerSourcePex
        // If they prefer encryption, they must support it.
        if fs.Get(peer_protocol.PexPrefersEncryption) {
                me.SupportsEncryption = true
index f5b4adaea83d65b93d102b636424a93909d2f36e..d10750e3a32ebfd47ee536a0807b0b44813e7680 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1254,7 +1254,7 @@ func (cl *Client) onDHTAnnouncePeer(ih metainfo.Hash, ip net.IP, port int, portO
        t.addPeers([]Peer{{
                IP:     ip,
                Port:   port,
-               Source: peerSourceDHTAnnouncePeer,
+               Source: peerSourceDhtAnnouncePeer,
        }})
 }
 
index cb24082625cf9e2f7370f01b2b28bf39581ba8ba..8e415a5039eff158a1168a93f484f16fd55cf985 100644 (file)
@@ -31,9 +31,9 @@ type peerSource string
 const (
        peerSourceTracker         = "Tr"
        peerSourceIncoming        = "I"
-       peerSourceDHTGetPeers     = "Hg" // Peers we found by searching a DHT.
-       peerSourceDHTAnnouncePeer = "Ha" // Peers that were announced to us by a DHT.
-       peerSourcePEX             = "X"
+       peerSourceDhtGetPeers     = "Hg" // Peers we found by searching a DHT.
+       peerSourceDhtAnnouncePeer = "Ha" // Peers that were announced to us by a DHT.
+       peerSourcePex             = "X"
 )
 
 // Maintains the state of a connection with a peer.
index 838011c475b897a844ac5e2193d711f68d47eeaf..917367e86eaa0fa8cb54030442cb5a6449fa2d7b 100644 (file)
@@ -1341,7 +1341,7 @@ func (t *Torrent) consumeDhtAnnouncePeers(pvs <-chan dht.PeersValues) {
                        t.addPeer(Peer{
                                IP:     cp.IP[:],
                                Port:   cp.Port,
-                               Source: peerSourceDHTGetPeers,
+                               Source: peerSourceDhtGetPeers,
                        })
                }
                cl.unlock()