]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Piece.everHashed is replaced by storageCompletionOk
authorMatt Joiner <anacrolix@gmail.com>
Sat, 3 Feb 2018 01:14:39 +0000 (12:14 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sat, 3 Feb 2018 01:14:39 +0000 (12:14 +1100)
piece.go
torrent.go

index 1f094813007175849a77413e7f4414e97647aa65..5db87d6a66694472a6ed6d343a74f6adcada6541 100644 (file)
--- a/piece.go
+++ b/piece.go
@@ -49,7 +49,6 @@ type Piece struct {
        dirtyChunks bitmap.Bitmap
 
        hashing             bool
-       everHashed          bool
        numVerifies         int64
        storageCompletionOk bool
 
index 2846d275485aa572da4157f9fada185848479002..46c37a8869ed8213f7ed9087e2d15d1ba5143664 100644 (file)
@@ -1502,7 +1502,7 @@ func (t *Torrent) pieceHashed(piece int, correct bool) {
        }
        p := &t.pieces[piece]
        touchers := t.reapPieceTouchers(piece)
-       if p.everHashed {
+       if p.storageCompletionOk {
                // Don't score the first time a piece is hashed, it could be an
                // initial check.
                if correct {
@@ -1512,7 +1512,6 @@ func (t *Torrent) pieceHashed(piece int, correct bool) {
                        pieceHashedNotCorrect.Add(1)
                }
        }
-       p.everHashed = true
        if correct {
                if len(touchers) != 0 {
                        t.stats.PiecesDirtiedGood++