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:
authormalone <toby.walsh@fxhome.com>2017-03-13 00:18:08 +0300
committermalone <toby.walsh@fxhome.com>2017-03-13 00:18:08 +0300
commit2f7583a523a4a84bee671e435033d18c3585fc2b (patch)
tree89d25b91ebf136fd71058cb7f056715737717260 /lib/torrent.js
parent1ce57971cccaaf7703a1baf80097f2fe0f620f38 (diff)
Fix detection of seeding peers
Diffstat (limited to 'lib/torrent.js')
-rw-r--r--lib/torrent.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index ae3e256..d09395f 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -1046,10 +1046,10 @@ Torrent.prototype._onWireWithMetadata = function (wire) {
}
}
- var i = 0
+ var i
function updateSeedStatus () {
- if (wire.peerPieces.length !== self.pieces.length) return
- for (; i < self.pieces.length; ++i) {
+ if (wire.peerPieces.buffer.length !== self.bitfield.buffer.length) return
+ for (i = 0; i < self.pieces.length; ++i) {
if (!wire.peerPieces.get(i)) return
}
wire.isSeeder = true