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.
- package/lib/merkle-tree.js +3 -0
- package/lib/replicator.js +7 -2
- package/package.json +1 -1
package/lib/merkle-tree.js
CHANGED
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 >=
|
|
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)
|