From: Matt Joiner Date: Sun, 28 Jan 2018 05:02:14 +0000 (+1100) Subject: Synchronize piece completion on piece hash failure X-Git-Tag: v1.0.0~251 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5ef22a978bcb4ca7026b3f778d46aaac4ebb46a5;p=btrtrc.git Synchronize piece completion on piece hash failure Pieces that were unknown, remained unknown despite hashing for that very reason. --- diff --git a/torrent.go b/torrent.go index 976a04e3..f342de22 100644 --- a/torrent.go +++ b/torrent.go @@ -1486,7 +1486,6 @@ func (t *Torrent) pieceHashed(piece int, correct bool) { if err != nil { log.Printf("%T: error marking piece complete %d: %s", t.storage, piece, err) } - t.updatePieceCompletion(piece) } else { if len(touchers) != 0 { for _, c := range touchers { @@ -1507,7 +1506,9 @@ func (t *Torrent) pieceHashed(piece int, correct bool) { c.Drop() } t.onIncompletePiece(piece) + p.Storage().MarkNotComplete() } + t.updatePieceCompletion(piece) } func (t *Torrent) cancelRequestsForPiece(piece int) {