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
t.addPeers([]Peer{{
IP: ip,
Port: port,
- Source: peerSourceDHTAnnouncePeer,
+ Source: peerSourceDhtAnnouncePeer,
}})
}
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.
t.addPeer(Peer{
IP: cp.IP[:],
Port: cp.Port,
- Source: peerSourceDHTGetPeers,
+ Source: peerSourceDhtGetPeers,
})
}
cl.unlock()