From: Matt Joiner Date: Thu, 25 Jul 2019 04:13:42 +0000 (+1000) Subject: Comments on the VerifyData methods X-Git-Tag: v1.5.0~1 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e9b10f774d3c410966d40f591d23a4481f8f96c3;p=btrtrc.git Comments on the VerifyData methods --- diff --git a/piece.go b/piece.go index 65988595..6808413a 100644 --- a/piece.go +++ b/piece.go @@ -178,6 +178,7 @@ func (p *Piece) bytesLeft() (ret pp.Integer) { 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 26f23869..9b1a920b 100644 --- a/torrent.go +++ b/torrent.go @@ -1666,6 +1666,7 @@ func (t *Torrent) queuePieceCheck(pieceIndex 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()