diff options
author | Julen Garcia Leunda <hicom150@gmail.com> | 2020-11-12 19:04:53 +0300 |
---|---|---|
committer | Julen Garcia Leunda <hicom150@gmail.com> | 2020-11-12 19:04:53 +0300 |
commit | 0ba67b8e8f54d888ba0dd14a6e5f4a18d46e1294 (patch) | |
tree | 4d831e47fcec3182e9cc33830143bcaef5be685f /lib | |
parent | e5445be2f5d64bc545211c604e106dc3bcb10385 (diff) |
Add lsd option to client
Diffstat (limited to 'lib')
-rw-r--r-- | lib/torrent.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 0db32e3..8787e53 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -334,14 +334,16 @@ class Torrent extends EventEmitter { dht: !this.private && this.client.dht, tracker: trackerOpts, port: this.client.torrentPort, - userAgent: USER_AGENT + userAgent: USER_AGENT, + lsd: this.client.lsd }) this.discovery.on('error', (err) => { this._destroy(err) }) - this.discovery.on('peer', (peer) => { + this.discovery.on('peer', (peer, source) => { + this._debug('peer %s discovered via %s', peer, source) // Don't create new outgoing TCP connections when torrent is done if (typeof peer === 'string' && this.done) return this.addPeer(peer) |