Skip to content

Commit

Permalink
print hash rate
Browse files Browse the repository at this point in the history
  • Loading branch information
mh0lt committed Jul 18, 2024
1 parent 8d57784 commit 3185ae2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions t.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ func (t *Torrent) DownloadPieces(begin, end pieceIndex) {

if completion.Complete {
complete.Add(int64(piece.length(true)))
fmt.Println("DL complete", hashed.Load())
return nil
}

Expand All @@ -265,6 +266,7 @@ func (t *Torrent) DownloadPieces(begin, end pieceIndex) {

if checkCompletion && !storage.IsNew() {
hashed.Add(int64(piece.length(true)))
fmt.Println("DL hashed", hashed.Load())
if sum, _, err := t.hashPiece(piece); err == nil && sum == *piece.hash {
storage.MarkComplete(false)
t.updatePieceCompletion(i, true)
Expand Down

0 comments on commit 3185ae2

Please sign in to comment.