From 3532f39690cd1500986954400e72b8798da4f251 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Sat, 24 Oct 2015 14:50:43 -0400 Subject: [PATCH] decrement storage size when purging torrents Fixes #96. --- tracker/storage.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tracker/storage.go b/tracker/storage.go index 1ec59de..dbcd738 100644 --- a/tracker/storage.go +++ b/tracker/storage.go @@ -191,6 +191,7 @@ func (s *Storage) PurgeInactiveTorrent(infohash string) error { } if torrent.PeerCount() == 0 { + atomic.AddInt32(&s.size, -1) delete(shard.torrents, infohash) }