dht-rpc 6.16.1 → 6.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/query.js +5 -3
  2. package/package.json +1 -1
package/lib/query.js CHANGED
@@ -277,12 +277,14 @@ module.exports = class Query extends Readable {
277
277
  }
278
278
  }
279
279
 
280
- _onerror (_, req) {
280
+ _onerror (err, req) {
281
281
  const addr = req.to.host + ':' + req.to.port
282
282
  const refs = this._seen.get(addr)
283
283
 
284
- this._seen.set(addr, DOWN)
285
- for (const node of refs) this._downHint(node, req.to)
284
+ if (err.code === 'REQUEST_TIMEOUT') {
285
+ this._seen.set(addr, DOWN)
286
+ for (const node of refs) this._downHint(node, req.to)
287
+ }
286
288
 
287
289
  this._dec(req)
288
290
  this.errors++
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dht-rpc",
3
- "version": "6.16.1",
3
+ "version": "6.16.2",
4
4
  "description": "Make RPC calls over a Kademlia based DHT",
5
5
  "main": "index.js",
6
6
  "files": [