]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Update piece priority after processing piece hash result
authorMatt Joiner <anacrolix@gmail.com>
Fri, 8 Oct 2021 23:26:52 +0000 (10:26 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 19 Oct 2021 03:03:03 +0000 (14:03 +1100)
Seems to avoid some silly performance issues in triggering request updates due to a piece still pending while being marked.

torrent.go

index 49d69fe7bab6190ccb586d6afe5bcb5f548be1d6..0f8ab9b556d748fabefb15d53a91827c75c24ced 100644 (file)
@@ -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()
 }