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:
authorJonathan Harper <jharper@eecs.berkeley.edu>2016-04-27 07:19:54 +0300
committerJonathan Harper <jharper@eecs.berkeley.edu>2016-04-27 07:19:54 +0300
commit97130eb7de2db1eac9f91482ca92b2da3b975eab (patch)
tree596277ed2b1c17afe300cf966743c55897937b43
parent98248991cf7aa909044b5461969ed55ad4a9c8d9 (diff)
Update 'noPeers' to stop using deprecated 'torrent.swarm'
-rw-r--r--lib/torrent.js4
-rw-r--r--test/node/download-dht-torrent.js2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index afd0691..ab84a9a 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -333,12 +333,12 @@ Torrent.prototype._onListening = function () {
function onTrackerAnnounce () {
self.emit('trackerAnnounce')
- if (self.swarm.numPeers === 0) self.emit('noPeers', 'tracker')
+ if (self.numPeers === 0) self.emit('noPeers', 'tracker')
}
function onDHTAnnounce () {
self.emit('dhtAnnounce')
- if (self.swarm.numPeers === 0) self.emit('noPeers', 'dht')
+ if (self.numPeers === 0) self.emit('noPeers', 'dht')
}
function onWarning (err) {
diff --git a/test/node/download-dht-torrent.js b/test/node/download-dht-torrent.js
index 874288d..0bc6961 100644
--- a/test/node/download-dht-torrent.js
+++ b/test/node/download-dht-torrent.js
@@ -6,7 +6,7 @@ var test = require('tape')
var WebTorrent = require('../../')
test('Download using DHT (via .torrent file)', function (t) {
- t.plan(9)
+ t.plan(10)
var dhtServer = new DHT({ bootstrap: false })