From 00e90243adb411ac5ee22356c8ab83d73823590d Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 18 Feb 2016 18:53:20 -0800 Subject: dht error should destroy the whole client --- index.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'index.js') diff --git a/index.js b/index.js index a3c5410..09b18b0 100644 --- a/index.js +++ b/index.js @@ -83,6 +83,10 @@ function WebTorrent (opts) { if (opts.dht !== false && typeof DHT === 'function' /* browser exclude */) { // use a single DHT instance for all torrents, so the routing table can be reused self.dht = new DHT(extend({ nodeId: self.nodeId }, opts.dht)) + self.dht.once('error', function (err) { + self.emit('error', err) + self.destroy() + }) self.dht.listen(opts.dhtPort) } else { self.dht = false -- cgit v1.2.3