hypercore 11.0.46 → 11.0.47
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/copy-prologue.js +7 -1
- package/package.json +1 -1
package/lib/copy-prologue.js
CHANGED
|
@@ -91,7 +91,13 @@ async function flushBatch (prologue, src, dst, batch) {
|
|
|
91
91
|
// reads done!
|
|
92
92
|
|
|
93
93
|
if (batch.first) {
|
|
94
|
-
const
|
|
94
|
+
const roots = nodes.slice(0, batch.roots.length)
|
|
95
|
+
|
|
96
|
+
for (const node of roots) {
|
|
97
|
+
if (!node) throw new Error('Missing nodes for prologue hash')
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const treeHash = crypto.tree(roots)
|
|
95
101
|
if (!b4a.equals(treeHash, prologue.hash)) throw new Error('Prologue does not match source')
|
|
96
102
|
}
|
|
97
103
|
|