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:
authorFeross Aboukhadijeh <feross@feross.org>2017-01-18 11:47:05 +0300
committerGitHub <noreply@github.com>2017-01-18 11:47:05 +0300
commit3ef228967f022115d7419ce5b3248df7a494b7a5 (patch)
tree57e96af7732d0dae395cdf74c174caa9ae94f6bc
parent9ef79bd384cfcd836cf66d069368959cf626d85c (diff)
parent6f3d4a54007909f9a22e4dc3bdefd40af0d39d6b (diff)
Merge pull request #991 from sidd/master
Don't send 'completed' event to tracker on client.seed
-rw-r--r--lib/torrent.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index 0b69556..ad0785d 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -1532,7 +1532,7 @@ Torrent.prototype._request = function (wire, index, hotswap) {
wire.have(index)
})
- self._checkDone()
+ if (self._checkDone()) self.discovery.complete()
} else {
self.pieces[index] = new Piece(piece.length)
self.emit('warning', new Error('Piece ' + index + ' failed verification'))
@@ -1579,11 +1579,11 @@ Torrent.prototype._checkDone = function () {
if (!self.done && done) {
self.done = true
self._debug('torrent done: ' + self.infoHash)
- self.discovery.complete()
self.emit('done')
}
-
self._gcSelections()
+
+ return done
}
Torrent.prototype.load = function (streams, cb) {