hypercore 10.37.14 → 10.37.15
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/core.js +4 -4
- package/lib/merkle-tree.js +1 -1
- package/lib/replicator.js +3 -0
- package/package.json +2 -2
package/lib/core.js
CHANGED
|
@@ -127,9 +127,9 @@ module.exports = class Core {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
// unslab the long lived buffers to avoid keeping the slab alive
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
header.key = unslab(header.key)
|
|
131
|
+
header.tree.rootHash = unslab(header.tree.rootHash)
|
|
132
|
+
header.tree.signature = unslab(header.tree.signature)
|
|
133
133
|
|
|
134
134
|
if (opts.manifest) {
|
|
135
135
|
// if we provide a manifest and no key, verify that the stored key is the same
|
|
@@ -193,7 +193,7 @@ module.exports = class Core {
|
|
|
193
193
|
if (e.treeUpgrade) {
|
|
194
194
|
const batch = await tree.truncate(e.treeUpgrade.length, e.treeUpgrade.fork)
|
|
195
195
|
batch.ancestors = e.treeUpgrade.ancestors
|
|
196
|
-
batch.signature =
|
|
196
|
+
batch.signature = unslab(e.treeUpgrade.signature)
|
|
197
197
|
addReorgHint(header.hints.reorgs, tree, batch)
|
|
198
198
|
batch.commit()
|
|
199
199
|
|
package/lib/merkle-tree.js
CHANGED
|
@@ -982,7 +982,7 @@ function verifyUpgrade ({ fork, upgrade }, blockRoot, batch) {
|
|
|
982
982
|
ite.sibling()
|
|
983
983
|
}
|
|
984
984
|
|
|
985
|
-
batch.signature =
|
|
985
|
+
batch.signature = unslab(upgrade.signature)
|
|
986
986
|
batch.fork = fork
|
|
987
987
|
|
|
988
988
|
return q.extra === null
|
package/lib/replicator.js
CHANGED
|
@@ -1108,6 +1108,8 @@ class Peer {
|
|
|
1108
1108
|
if (h.inflight.length > 0) continue
|
|
1109
1109
|
|
|
1110
1110
|
const req = this._makeRequest(false, h.priority, index + 1)
|
|
1111
|
+
if (req === null) continue
|
|
1112
|
+
|
|
1111
1113
|
const nodes = flatTree.depth(s.seeker.start + s.seeker.end - 1)
|
|
1112
1114
|
|
|
1113
1115
|
req.hash = { index: 2 * index, nodes }
|
|
@@ -1299,6 +1301,7 @@ class Peer {
|
|
|
1299
1301
|
if (this._remoteHasBlock(index) === false) continue
|
|
1300
1302
|
|
|
1301
1303
|
const req = this._makeRequest(false, 0, 0)
|
|
1304
|
+
if (req === null) continue
|
|
1302
1305
|
|
|
1303
1306
|
req.hash = { index: 2 * index, nodes: f.batch.want.nodes }
|
|
1304
1307
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hypercore",
|
|
3
|
-
"version": "10.37.
|
|
3
|
+
"version": "10.37.15",
|
|
4
4
|
"description": "Hypercore is a secure, distributed append-only log",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"safety-catch": "^1.0.1",
|
|
62
62
|
"sodium-universal": "^4.0.0",
|
|
63
63
|
"streamx": "^2.12.4",
|
|
64
|
-
"unslab": "^1.
|
|
64
|
+
"unslab": "^1.3.0",
|
|
65
65
|
"xache": "^1.1.0",
|
|
66
66
|
"z32": "^1.0.0"
|
|
67
67
|
},
|