]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Pieces being marked should have priority none
authorMatt Joiner <anacrolix@gmail.com>
Sat, 9 Oct 2021 03:20:54 +0000 (14:20 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 19 Oct 2021 03:00:52 +0000 (14:00 +1100)
Also reorder the checks a bit to favour the cheaper ones.

piece.go

index 6376c8c1c4d2b279f8befed52fe59b89b6c0e7df..20c5c19a28399b8e97d6eaf7febbae76071f0f24 100644 (file)
--- a/piece.go
+++ b/piece.go
@@ -212,7 +212,7 @@ func (p *Piece) purePriority() (ret piecePriority) {
 }
 
 func (p *Piece) uncachedPriority() (ret piecePriority) {
-       if p.t.pieceComplete(p.index) || p.t.pieceQueuedForHash(p.index) || p.t.hashingPiece(p.index) {
+       if p.hashing || p.marking || p.t.pieceComplete(p.index) || p.queuedForHash() {
                return PiecePriorityNone
        }
        return p.purePriority()