Remove the rest of slots
This commit is contained in:
parent
f9d65db5b0
commit
fe1a4a6a65
2 changed files with 0 additions and 26 deletions
|
@ -53,7 +53,5 @@ type User struct {
|
|||
|
||||
UpMultiplier float64 `json:"up_multiplier"`
|
||||
DownMultiplier float64 `json:"down_multiplier"`
|
||||
Slots int64 `json:"slots"`
|
||||
SlotsUsed int64 `json:"slots_used"`
|
||||
Snatches uint64 `json:"snatches"`
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue