From b9fb0bf2a22c56eebb8ec98660ee02a7b8284c45 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 8 Jan 2020 07:29:12 +1100 Subject: [PATCH] Don't create piece hashers for closed Torrents --- torrent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torrent.go b/torrent.go index 9b353b44..51ef3681 100644 --- a/torrent.go +++ b/torrent.go @@ -1618,7 +1618,7 @@ func (t *Torrent) onIncompletePiece(piece pieceIndex) { } func (t *Torrent) tryCreateMorePieceHashers() { - for t.activePieceHashes < 2 && t.tryCreatePieceHasher() { + for !t.closed.IsSet() && t.activePieceHashes < 2 && t.tryCreatePieceHasher() { } } -- 2.48.1