diff options
author | Alex <alxmorais8@msn.com> | 2019-08-11 20:11:38 +0300 |
---|---|---|
committer | Alex <alxmorais8@msn.com> | 2019-08-11 20:11:38 +0300 |
commit | cd43d50b15e17abd575b2aa1ac0b07010c84324d (patch) | |
tree | 0ff2f9089343dfb7b20d7aa4afa596a35fc2092c /lib | |
parent | 72a2fa9477ab4be51bfbda5ed4dce90766ac57d5 (diff) |
Fix 'left' parameter on seed
Diffstat (limited to 'lib')
-rw-r--r-- | lib/torrent.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index ef541ea..0254b87 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -300,6 +300,14 @@ class Torrent extends EventEmitter { }) } + if (this.info) { + // if full metadata was included in initial torrent id, use it immediately. Otherwise, + // wait for torrent-discovery to find peers and ut_metadata to get the metadata. + this._onMetadata(this) + } else if (this.xs) { + this._getMetadataFromServer() + } + // begin discovering peers via DHT and trackers this.discovery = new Discovery({ infoHash: this.infoHash, @@ -334,14 +342,6 @@ class Torrent extends EventEmitter { this.discovery.on('warning', (err) => { this.emit('warning', err) }) - - if (this.info) { - // if full metadata was included in initial torrent id, use it immediately. Otherwise, - // wait for torrent-discovery to find peers and ut_metadata to get the metadata. - this._onMetadata(this) - } else if (this.xs) { - this._getMetadataFromServer() - } } _getMetadataFromServer () { |