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
path: root/lib
diff options
context:
space:
mode:
authorJonathan Harper <jharper@eecs.berkeley.edu>2016-04-27 06:59:29 +0300
committerJonathan Harper <jharper@eecs.berkeley.edu>2016-04-27 07:12:25 +0300
commitcd7fcb2d797cccf9507557493146e6a498f16861 (patch)
tree746c1471b2be54b5597c04b80838958d92c0094c /lib
parent4e28de9e5df522689b18f4c76fffedea66fa156d (diff)
Torrent emits 'noPeers' even when swarm is empty after announce
Diffstat (limited to 'lib')
-rw-r--r--lib/torrent.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index b574fbb..afd0691 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -333,10 +333,12 @@ Torrent.prototype._onListening = function () {
function onTrackerAnnounce () {
self.emit('trackerAnnounce')
+ if (self.swarm.numPeers === 0) self.emit('noPeers', 'tracker')
}
function onDHTAnnounce () {
self.emit('dhtAnnounce')
+ if (self.swarm.numPeers === 0) self.emit('noPeers', 'dht')
}
function onWarning (err) {