From: Matt Joiner Date: Fri, 8 Oct 2021 23:26:52 +0000 (+1100) Subject: Update piece priority after processing piece hash result X-Git-Tag: v1.34.0~5 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=6f196c8d33d43f56e182a95243d3072b1d775631;p=btrtrc.git 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. --- 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() }