From e9b10f774d3c410966d40f591d23a4481f8f96c3 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 25 Jul 2019 14:13:42 +1000 Subject: [PATCH] Comments on the VerifyData methods --- piece.go | 1 + torrent.go | 1 + 2 files changed, 2 insertions(+) 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() -- 2.44.0