hypercore 11.0.46 → 11.0.48

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/lib/replicator.js CHANGED
@@ -1520,6 +1520,7 @@ module.exports = class Replicator {
1520
1520
  }
1521
1521
 
1522
1522
  this._downloadingTimer = setTimeout(setDownloadingLater, this._notDownloadingLinger, this, downloading)
1523
+ if (this._downloadingTimer.unref) this._downloadingTimer.unref()
1523
1524
  }
1524
1525
 
1525
1526
  setDownloadingNow (downloading) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "11.0.46",
3
+ "version": "11.0.48",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {