diff --git a/tracker/announce.go b/tracker/announce.go index 3ef1936..e52aa37 100644 --- a/tracker/announce.go +++ b/tracker/announce.go @@ -171,14 +171,6 @@ func handleEvent(c Conn, ann *models.Announce) (snatched bool, err error) { } ann.Torrent.Snatches++ } - - if snatched && ann.Config.PrivateEnabled { - err = c.IncrementUserSnatches(ann.User.Passkey) - if err != nil { - return - } - ann.User.Snatches++ - } return } diff --git a/tracker/conn.go b/tracker/conn.go index e10bc2d..a1c7017 100644 --- a/tracker/conn.go +++ b/tracker/conn.go @@ -77,7 +77,6 @@ type Conn interface { FindUser(passkey string) (*models.User, error) PutUser(u *models.User) error DeleteUser(passkey string) error - IncrementUserSnatches(passkey string) error // Whitelist interactions FindClient(clientID string) error diff --git a/tracker/memory/conn.go b/tracker/memory/conn.go index 6b3f663..05b3797 100644 --- a/tracker/memory/conn.go +++ b/tracker/memory/conn.go @@ -67,19 +67,6 @@ func (c *Conn) IncrementTorrentSnatches(infohash string) error { return nil } -func (c *Conn) IncrementUserSnatches(userID string) error { - c.usersM.Lock() - defer c.usersM.Unlock() - - u, exists := c.users[userID] - if !exists { - return models.ErrUserDNE - } - u.Snatches++ - - return nil -} - func (c *Conn) TouchTorrent(infohash string) error { c.torrentsM.Lock() defer c.torrentsM.Unlock() diff --git a/tracker/models/models.go b/tracker/models/models.go index ae2e93a..cdfbdc0 100644 --- a/tracker/models/models.go +++ b/tracker/models/models.go @@ -169,7 +169,6 @@ type User struct { UpMultiplier float64 `json:"up_multiplier"` DownMultiplier float64 `json:"down_multiplier"` - Snatches uint64 `json:"snatches"` // TODO deleteme } // Announce is an Announce by a Peer.