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:
authorFeross Aboukhadijeh <feross@feross.org>2016-05-05 16:12:58 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-05-05 16:12:58 +0300
commitf09c24ab46b6748c6948eedb8af85075ca71692f (patch)
tree330c1078c2a7bf36b9575d8de9059825cff60f29 /lib
parent43aeb613cadb0fa986902f20c66f64e76cc427a4 (diff)
parent97130eb7de2db1eac9f91482ca92b2da3b975eab (diff)
Merge pull request #775 from harperj/no-peers
Add 'noPeers' event to torrents
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 d4c55e3..810e10d 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -333,10 +333,12 @@ Torrent.prototype._onListening = function () {
function onTrackerAnnounce () {
self.emit('trackerAnnounce')
+ if (self.numPeers === 0) self.emit('noPeers', 'tracker')
}
function onDHTAnnounce () {
self.emit('dhtAnnounce')
+ if (self.numPeers === 0) self.emit('noPeers', 'dht')
}
function onWarning (err) {