Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/file.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/file.js b/lib/file.js
index d912faa..eb2fc21 100644
--- a/lib/file.js
+++ b/lib/file.js
@@ -45,7 +45,7 @@ Object.defineProperty(File.prototype, 'downloaded', {
for (var index = this._startPiece; index <= this._endPiece; ++index) {
if (this._torrent.bitfield.get(index)) {
// verified data
- downloaded += this._torrent.pieceLength
+ downloaded += (index === this._endPiece) ? this._torrent.lastPieceLength : this._torrent.pieceLength
} else {
// "in progress" data
var piece = this._torrent.pieces[index]