hypercore 10.37.15 → 10.37.16

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.
package/index.js CHANGED
@@ -270,6 +270,14 @@ module.exports = class Hypercore extends EventEmitter {
270
270
  this.writable = this._isWritable()
271
271
  }
272
272
 
273
+ setActive (bool) {
274
+ const active = !!bool
275
+ if (active === this._active) return
276
+ this._active = active
277
+ if (!this.opened || this.closing) return
278
+ this.replicator.updateActivity(this._active ? 1 : -1)
279
+ }
280
+
273
281
  _passCapabilities (o) {
274
282
  if (!this.keyPair) this.keyPair = o.keyPair
275
283
  this.crypto = o.crypto
package/lib/replicator.js CHANGED
@@ -1301,7 +1301,6 @@ class Peer {
1301
1301
  if (this._remoteHasBlock(index) === false) continue
1302
1302
 
1303
1303
  const req = this._makeRequest(false, 0, 0)
1304
- if (req === null) continue
1305
1304
 
1306
1305
  req.hash = { index: 2 * index, nodes: f.batch.want.nodes }
1307
1306
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "10.37.15",
3
+ "version": "10.37.16",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {