decrement storage size when purging torrents

Fixes #96.
This commit is contained in:
Jimmy Zelinskie 2015-10-24 14:50:43 -04:00
parent 18e1599759
commit 3532f39690

View file

@ -191,6 +191,7 @@ func (s *Storage) PurgeInactiveTorrent(infohash string) error {
}
if torrent.PeerCount() == 0 {
atomic.AddInt32(&s.size, -1)
delete(shard.torrents, infohash)
}