Only prune torrents if they have no peers

This commit is contained in:
Justin Li
2014-07-16 14:11:01 -04:00
parent 5f4f63cc44
commit e29fb21edb
3 changed files with 14 additions and 3 deletions
+1 -1
View File
@@ -213,7 +213,7 @@ func (c *Conn) PurgeInactiveTorrents(before time.Time) error {
c.torrentsM.RLock()
for key, torrent := range c.torrents {
if torrent.LastAction < unixtime {
if torrent.LastAction < unixtime && torrent.PeerCount() == 0 {
queue = append(queue, key)
}
}