mirror of
https://github.com/LBRYFoundation/tracker.git
synced 2025-08-23 17:47:29 +00:00
Only decrement torrent map size if hash exists
This commit is contained in:
parent
9fea8195bb
commit
f74ef67d08
1 changed files with 4 additions and 2 deletions
|
@ -101,8 +101,10 @@ func (s *Storage) DeleteTorrent(infohash string) {
|
||||||
shard := s.GetTorrentShard(infohash, false)
|
shard := s.GetTorrentShard(infohash, false)
|
||||||
defer shard.Unlock()
|
defer shard.Unlock()
|
||||||
|
|
||||||
atomic.AddInt32(&s.size, -1)
|
if _, exists := shard.torrents[infohash]; exists {
|
||||||
delete(shard.torrents, infohash)
|
atomic.AddInt32(&s.size, -1)
|
||||||
|
delete(shard.torrents, infohash)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Storage) IncrementTorrentSnatches(infohash string) error {
|
func (s *Storage) IncrementTorrentSnatches(infohash string) error {
|
||||||
|
|
Loading…
Add table
Reference in a new issue