From: Matt Joiner <anacrolix@gmail.com>
Date: Sat, 3 Feb 2018 01:14:39 +0000 (+1100)
Subject: Piece.everHashed is replaced by storageCompletionOk
X-Git-Tag: v1.0.0~218
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e67b85215ca7b9c8371b32d36467b0321cac33d5;p=btrtrc.git

Piece.everHashed is replaced by storageCompletionOk
---

diff --git a/piece.go b/piece.go
index 1f094813..5db87d6a 100644
--- a/piece.go
+++ b/piece.go
@@ -49,7 +49,6 @@ type Piece struct {
 	dirtyChunks bitmap.Bitmap
 
 	hashing             bool
-	everHashed          bool
 	numVerifies         int64
 	storageCompletionOk bool
 
diff --git a/torrent.go b/torrent.go
index 2846d275..46c37a88 100644
--- a/torrent.go
+++ b/torrent.go
@@ -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++