mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-12 07:43:32 -07:00
Only decrement torrent map size if hash exists
This commit is contained in:
+4
-2
@@ -101,8 +101,10 @@ func (s *Storage) DeleteTorrent(infohash string) {
|
||||
shard := s.GetTorrentShard(infohash, false)
|
||||
defer shard.Unlock()
|
||||
|
||||
atomic.AddInt32(&s.size, -1)
|
||||
delete(shard.torrents, infohash)
|
||||
if _, exists := shard.torrents[infohash]; exists {
|
||||
atomic.AddInt32(&s.size, -1)
|
||||
delete(shard.torrents, infohash)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Storage) IncrementTorrentSnatches(infohash string) error {
|
||||
|
||||
Reference in New Issue
Block a user