mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-14 08:33:36 -07:00
Fix semantics of seed stats, fix Peer.IPv6() always returning true
This commit is contained in:
@@ -71,11 +71,11 @@ func NewPeer(a *Announce, u *User, t *Torrent) *Peer {
|
||||
}
|
||||
|
||||
func (p *Peer) IPv4() bool {
|
||||
return len(p.IP.To4()) == 4
|
||||
return p.IP.To4() != nil
|
||||
}
|
||||
|
||||
func (p *Peer) IPv6() bool {
|
||||
return len(p.IP.To16()) == 16
|
||||
return !p.IPv4()
|
||||
}
|
||||
|
||||
// Torrent is a swarm for a given torrent file.
|
||||
|
||||
Reference in New Issue
Block a user