diff options
author | Alex <alxmorais8@msn.com> | 2017-09-25 12:22:52 +0300 |
---|---|---|
committer | Alex <alxmorais8@msn.com> | 2017-09-25 12:22:52 +0300 |
commit | 54ce21637fa054271e025f2c4b4ead558bec95ad (patch) | |
tree | ae25eb44e2a38ec5604545c9a5a3d5994f66461e /lib/file.js | |
parent | 598d944c07b190e7e7e976b1b44d857cf0b2c14d (diff) |
Fix file.downloaded for last piece
Diffstat (limited to 'lib/file.js')
-rw-r--r-- | lib/file.js | 2 |
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] |