mirror of
https://github.com/sot-tech/mochi.git
synced 2026-04-30 01:19:59 -07:00
Remove the rest of slots
This commit is contained in:
@@ -153,30 +153,6 @@ func (c *Conn) SetSeeder(t *storage.Torrent, p *storage.Peer) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Conn) IncrementSlots(u *storage.User) error {
|
||||
c.usersM.Lock()
|
||||
defer c.usersM.Unlock()
|
||||
user, ok := c.users[u.Passkey]
|
||||
if !ok {
|
||||
return tracker.ErrMissingResource
|
||||
}
|
||||
user.Slots++
|
||||
u.Slots++
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Conn) DecrementSlots(u *storage.User) error {
|
||||
c.usersM.Lock()
|
||||
defer c.usersM.Unlock()
|
||||
user, ok := c.users[u.Passkey]
|
||||
if !ok {
|
||||
return tracker.ErrMissingResource
|
||||
}
|
||||
user.Slots--
|
||||
u.Slots--
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Conn) LeecherFinished(t *storage.Torrent, p *storage.Peer) error {
|
||||
c.torrentsM.Lock()
|
||||
defer c.torrentsM.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user