Piece.everHashed is replaced by storageCompletionOk

This commit is contained in:
Matt Joiner 2018-02-03 12:14:39 +11:00
parent f23d097502
commit e67b85215c
2 changed files with 1 additions and 3 deletions

View File

@ -49,7 +49,6 @@ type Piece struct {
dirtyChunks bitmap.Bitmap
hashing bool
everHashed bool
numVerifies int64
storageCompletionOk bool

View 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++