diff options
author | Shachar Itzhaky <corwin.amber@gmail.com> | 2019-03-11 17:44:15 +0300 |
---|---|---|
committer | Shachar Itzhaky <corwin.amber@gmail.com> | 2019-03-11 17:44:15 +0300 |
commit | 88b4f5454329a8ad5dcad805fce1997d46b7637c (patch) | |
tree | f7b9349c540a038ff43c5db4f99a99b9b5c1ad5c /lib | |
parent | 1829dc225b7786cad4340d211b65012f974e4a6a (diff) |
Fixes #1515 and #1552.
Diffstat (limited to 'lib')
-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 e5624cd..8bcfe22 100644 --- a/lib/file.js +++ b/lib/file.js @@ -43,7 +43,7 @@ class File extends EventEmitter { // Calculate first piece diffrently, it sometimes have a offset let downloaded = bitfield.get(start) - ? pieceLength - this.offset + ? pieceLength - (this.offset % pieceLength) : Math.max(piece.length - piece.missing - this.offset, 0) for (let index = start + 1; index <= end; ++index) { |