diff options
author | malone <toby.walsh@fxhome.com> | 2017-03-13 00:18:08 +0300 |
---|---|---|
committer | malone <toby.walsh@fxhome.com> | 2017-03-13 00:18:08 +0300 |
commit | 2f7583a523a4a84bee671e435033d18c3585fc2b (patch) | |
tree | 89d25b91ebf136fd71058cb7f056715737717260 /lib/torrent.js | |
parent | 1ce57971cccaaf7703a1baf80097f2fe0f620f38 (diff) |
Fix detection of seeding peers
Diffstat (limited to 'lib/torrent.js')
-rw-r--r-- | lib/torrent.js | 6 |
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 |