diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-01-10 18:27:45 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-01-11 02:08:59 +0300 |
commit | ab2e4583734835499caeb75c787d0d1a9310a511 (patch) | |
tree | a7fc8f6f539c870ad595ef137c038acd849213c0 /lib | |
parent | 6140c79352c964b20fef6e1b8bf080efa14427e7 (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.js | 5 |
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) { |