]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Ignore cached piece completion state when verifying data
authorMatt Joiner <anacrolix@gmail.com>
Thu, 25 Jul 2019 04:10:21 +0000 (14:10 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 25 Jul 2019 04:10:21 +0000 (14:10 +1000)
Forcing data to be checked via VerifyData, and probably other places where piece checks are queued were being short-circuited due to cached piece completion. If a piece check is queued, or verifyData called, the cached completion state should be ignored.

torrent.go

index 15029945d1af9db6e5f190e8562349145c45d0f1..26f23869c906615e15f9512dd8eda5de5c95619c 100644 (file)
@@ -1619,7 +1619,7 @@ func (t *Torrent) verifyPiece(piece pieceIndex) {
                panic("piece was not queued")
        }
        t.updatePiecePriority(piece)
-       if t.closed.IsSet() || t.pieceComplete(piece) {
+       if t.closed.IsSet() {
                return
        }
        p.hashing = true