piece.go | 1 + torrent.go | 1 + diff --git a/piece.go b/piece.go index 6598859523150abd9cf78bcb6df5e577ed0484cd..6808413a9892c3b069a7ee683240964a7779d651 100644 --- a/piece.go +++ b/piece.go @@ -178,6 +178,7 @@ } return p.length() - p.numDirtyBytes() } +// Forces the piece data to be rehashed. func (p *Piece) VerifyData() { p.t.cl.lock() defer p.t.cl.unlock() diff --git a/torrent.go b/torrent.go index 26f23869c906615e15f9512dd8eda5de5c95619c..9b1a920b315feea380f466b93691d752bdb6209b 100644 --- a/torrent.go +++ b/torrent.go @@ -1666,6 +1666,7 @@ t.updatePiecePriority(pieceIndex) go t.verifyPiece(pieceIndex) } +// Forces all the pieces to be re-hashed. See also Piece.VerifyData. func (t *Torrent) VerifyData() { for i := pieceIndex(0); i < t.NumPieces(); i++ { t.Piece(i).VerifyData()