hypercore 11.22.0 → 11.22.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.
@@ -723,6 +723,9 @@ class MerkleTree {
723
723
  if (r === index) return 0
724
724
  }
725
725
 
726
+ // need missing nodes not inclusive of index
727
+ ite.parent()
728
+
726
729
  let cnt = 0
727
730
  while (!ite.contains(head)) {
728
731
  cnt++
package/lib/replicator.js CHANGED
@@ -915,7 +915,7 @@ class Peer {
915
915
  nodes: MerkleTree.maxMissingNodes(2 * index, remoteLength)
916
916
  }
917
917
 
918
- if (index >= this.remoteLength) {
918
+ if (index >= remoteLength) {
919
919
  msg.upgrade = {
920
920
  start: remoteLength,
921
921
  length: this.core.state.length - remoteLength
@@ -926,7 +926,8 @@ class Peer {
926
926
  const batch = this.core.storage.read()
927
927
  try {
928
928
  req = await this._getProof(batch, msg, true)
929
- } catch {
929
+ } catch (err) {
930
+ this.replicator._oninvalidrequest(err, msg, this)
930
931
  return
931
932
  }
932
933
 
@@ -1797,6 +1798,10 @@ module.exports = class Replicator {
1797
1798
  }
1798
1799
  }
1799
1800
 
1801
+ setInflightRange(min, max) {
1802
+ this.inflightRange = [min, max]
1803
+ }
1804
+
1800
1805
  updateActivity(inc, session) {
1801
1806
  this.activeSessions += inc
1802
1807
  this.setDownloading(this.activeSessions !== 0, session)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "11.22.0",
3
+ "version": "11.22.2",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {