hypercore 11.6.2 → 11.6.3
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/replicator.js +9 -2
- package/package.json +1 -1
package/lib/replicator.js
CHANGED
|
@@ -705,9 +705,14 @@ class Peer {
|
|
|
705
705
|
}
|
|
706
706
|
|
|
707
707
|
const manifest = (msg.manifest && !this.core.compat) ? this.core.header.manifest : null
|
|
708
|
-
const proof = await MerkleTree.proof(this.core.state, batch, msg)
|
|
709
708
|
|
|
710
|
-
|
|
709
|
+
try {
|
|
710
|
+
const proof = await MerkleTree.proof(this.core.state, batch, msg)
|
|
711
|
+
return new ProofRequest(msg, proof, block, manifest)
|
|
712
|
+
} catch (err) {
|
|
713
|
+
batch.destroy()
|
|
714
|
+
throw err
|
|
715
|
+
}
|
|
711
716
|
}
|
|
712
717
|
|
|
713
718
|
async onrequest (msg) {
|
|
@@ -1340,6 +1345,8 @@ class Peer {
|
|
|
1340
1345
|
}
|
|
1341
1346
|
|
|
1342
1347
|
_requestForkProof (f) {
|
|
1348
|
+
if (!this.remoteLength) return
|
|
1349
|
+
|
|
1343
1350
|
const req = this._makeRequest(false, 0, 0)
|
|
1344
1351
|
|
|
1345
1352
|
req.upgrade = { start: 0, length: this.remoteLength }
|