From 6f196c8d33d43f56e182a95243d3072b1d775631 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sat, 9 Oct 2021 10:26:52 +1100 Subject: [PATCH] Update piece priority after processing piece hash result Seems to avoid some silly performance issues in triggering request updates due to a piece still pending while being marked. --- torrent.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/torrent.go b/torrent.go index 49d69fe7..0f8ab9b5 100644 --- a/torrent.go +++ b/torrent.go @@ -2062,9 +2062,8 @@ func (t *Torrent) pieceHasher(index pieceIndex) { t.cl.lock() defer t.cl.unlock() p.hashing = false - t.updatePiecePriority(index) t.pieceHashed(index, correct, copyErr) - t.publishPieceChange(index) + t.updatePiecePriority(index) t.activePieceHashes-- t.tryCreateMorePieceHashers() } -- 2.48.1