diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-05-05 16:12:58 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-05-05 16:12:58 +0300 |
commit | f09c24ab46b6748c6948eedb8af85075ca71692f (patch) | |
tree | 330c1078c2a7bf36b9575d8de9059825cff60f29 /lib | |
parent | 43aeb613cadb0fa986902f20c66f64e76cc427a4 (diff) | |
parent | 97130eb7de2db1eac9f91482ca92b2da3b975eab (diff) |
Merge pull request #775 from harperj/no-peers
Add 'noPeers' event to torrents
Diffstat (limited to 'lib')
-rw-r--r-- | lib/torrent.js | 2 |
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) { |