torrent-discovery
Advanced tools
Comparing version 2.2.0 to 2.2.2
16
index.js
@@ -32,4 +32,9 @@ module.exports = Discovery | ||
if (!process.browser && !self.port) throw new Error('port required') | ||
if (process.browser && (!self.announce || self.announce.length === 0)) | ||
console.warn('Warning: must specify a tracker server to discover peers (required in browser because DHT is not implemented yet) (you can use wss://tracker.webtorrent.io)') | ||
if (process.browser && (!self.announce || self.announce.length === 0)) { | ||
console.warn( | ||
'Warning: specify a tracker server to discover peers. ' + | ||
'Required in browser because DHT is not implemented yet. ' + | ||
'(You can use wss://tracker.webtorrent.io.)' | ||
) | ||
} | ||
@@ -50,10 +55,11 @@ if (self.dht) self._createDHT(self.dhtPort) | ||
} | ||
debug('setTorrent %s', torrent) | ||
debug('setTorrent %s', self.infoHash) | ||
// If tracker exists, then it was created with just infoHash. Set torrent length | ||
// so client can report correct information about uploads. | ||
if (self.tracker && self.tracker !== true) | ||
if (self.tracker && self.tracker !== true) { | ||
self.tracker.torrentLength = torrent.length | ||
else | ||
} else { | ||
self._createTracker() | ||
} | ||
@@ -60,0 +66,0 @@ if (self.dht) { |
{ | ||
"name": "torrent-discovery", | ||
"description": "Discover BitTorrent peers via DHT and Trackers", | ||
"version": "2.2.0", | ||
"version": "2.2.2", | ||
"author": { | ||
@@ -28,2 +28,3 @@ "name": "Feross Aboukhadijeh", | ||
"hat": "0.0.3", | ||
"standard": "^3.1.2", | ||
"tape": "^3.5.0" | ||
@@ -52,4 +53,4 @@ }, | ||
"scripts": { | ||
"test": "tape test/*.js" | ||
"test": "standard && tape test/*.js" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10837
7
166
3