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-01-10 18:27:45 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-01-11 02:08:59 +0300
commitab2e4583734835499caeb75c787d0d1a9310a511 (patch)
treea7fc8f6f539c870ad595ef137c038acd849213c0 /lib
parent6140c79352c964b20fef6e1b8bf080efa14427e7 (diff)
emit 'infoHash` event sooner
This is still being nextTicked because `parseTorrent.remote` (called first) is always called on the next tick
Diffstat (limited to 'lib')
-rw-r--r--lib/torrent.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index 423e426..e3aec43 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -226,10 +226,7 @@ Torrent.prototype._onParsedTorrent = function (parsedTorrent) {
// next tick)
self.swarm.listen(self.client.torrentPort, self._onSwarmListening.bind(self))
- process.nextTick(function () {
- if (self.destroyed) return
- self.emit('infoHash', self.infoHash)
- })
+ self.emit('infoHash', self.infoHash)
}
Torrent.prototype._processParsedTorrent = function (parsedTorrent) {