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:
authorAlex <alxmorais8@msn.com>2019-08-11 20:11:38 +0300
committerAlex <alxmorais8@msn.com>2019-08-11 20:11:38 +0300
commitcd43d50b15e17abd575b2aa1ac0b07010c84324d (patch)
tree0ff2f9089343dfb7b20d7aa4afa596a35fc2092c /lib
parent72a2fa9477ab4be51bfbda5ed4dce90766ac57d5 (diff)
Fix 'left' parameter on seed
Diffstat (limited to 'lib')
-rw-r--r--lib/torrent.js16
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 () {