package torrent
import (
- "net"
-
"github.com/anacrolix/dht/v2/krpc"
"github.com/anacrolix/torrent/peer_protocol"
// Peer connection info, handed about publicly.
type PeerInfo struct {
Id [20]byte
- Addr net.Addr
+ Addr PeerRemoteAddr
Source PeerSource
// Peer is known to support encryption.
SupportsEncryption bool
}
func (me PeerInfo) addr() IpPort {
- return IpPort{IP: addrIpOrNil(me.Addr), Port: uint16(addrPortOrZero(me.Addr))}
+ ipPort, _ := tryIpPortFromNetAddr(me.Addr)
+ return IpPort{ipPort.IP, uint16(ipPort.Port)}
}