bittorrent-dht
Advanced tools
Comparing version 3.2.2 to 3.2.3
@@ -86,2 +86,3 @@ module.exports = DHT | ||
self._ipv = opts.ipv || 4 | ||
self._rotateInterval = null | ||
@@ -284,3 +285,2 @@ /** | ||
clearTimeout(self._bootstrapTimeout) | ||
clearInterval(self._rotateInterval) | ||
@@ -485,15 +485,17 @@ | ||
}) | ||
startBootstrapTimeout() | ||
} | ||
function startBootstrapTimeout () { | ||
setTimeout(function () { | ||
if (self.destroyed) return | ||
// If 0 nodes are in the table after a timeout, retry with bootstrap nodes | ||
if (self.nodes.count() === 0) { | ||
self._debug('No DHT bootstrap nodes replied, retry') | ||
lookup() | ||
} | ||
}, BOOTSTRAP_TIMEOUT).unref() | ||
} | ||
lookup() | ||
// TODO: keep retrying after one failure | ||
self._bootstrapTimeout = setTimeout(function () { | ||
if (self.destroyed) return | ||
// If 0 nodes are in the table after a timeout, retry with bootstrap nodes | ||
if (self.nodes.count() === 0) { | ||
self._debug('No DHT bootstrap nodes replied, retry') | ||
lookup() | ||
} | ||
}, BOOTSTRAP_TIMEOUT) | ||
if (self._bootstrapTimeout.unref) self._bootstrapTimeout.unref() | ||
}) | ||
@@ -500,0 +502,0 @@ } |
{ | ||
"name": "bittorrent-dht", | ||
"description": "Simple, robust, BitTorrent DHT implementation", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"author": { | ||
@@ -32,3 +32,3 @@ "name": "Feross Aboukhadijeh", | ||
"ip": "^0.3.0", | ||
"standard": "^3.3.1", | ||
"standard": "^4.5.2", | ||
"tape": "^4.0.0" | ||
@@ -35,0 +35,0 @@ }, |
1695
63626