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.
@@ -91,7 +91,13 @@ async function flushBatch (prologue, src, dst, batch) {
91
91
  // reads done!
92
92
 
93
93
  if (batch.first) {
94
- const treeHash = crypto.tree(nodes.slice(0, batch.roots.length))
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "11.0.46",
3
+ "version": "11.0.47",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {