mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-23 16:28:11 -07:00
rollout more stats
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user