rollout more stats

This commit is contained in:
Jimmy Zelinskie
2014-07-21 20:24:51 -04:00
parent 24f3e6b80b
commit 2c8894fbda
4 changed files with 43 additions and 8 deletions
+8
View File
@@ -70,6 +70,14 @@ func NewPeer(a *Announce, u *User, t *Torrent) *Peer {
}
}
func (p *Peer) IPv4() bool {
return len(p.IP.To4()) == 4
}
func (p *Peer) IPv6() bool {
return len(p.IP.To16()) == 16
}
// Torrent is a swarm for a given torrent file.
type Torrent struct {
ID uint64 `json:"id"`