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.
- package/lib/copy-prologue.js +7 -1
- package/lib/replicator.js +1 -0
- 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
|
|
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) {
|