Comparing version 2.19.1 to 2.19.2
12
index.js
@@ -123,2 +123,7 @@ const codecs = require('codecs') | ||
function preloadBlock (core, index) { | ||
if (core.replicator._blocks.get(index)) return | ||
core.get(index).catch(safetyCatch) | ||
} | ||
class TreeNode { | ||
@@ -141,3 +146,2 @@ constructor (block, keys, children, offset) { | ||
const missing = [] | ||
for (let i = 0; i < this.keys.length; i++) { | ||
@@ -147,3 +151,3 @@ const k = this.keys[i] | ||
if (k.seq >= core.length || bitfield.get(k.seq)) continue | ||
missing.push(k.seq) | ||
preloadBlock(core, k.seq) | ||
} | ||
@@ -154,6 +158,4 @@ for (let i = 0; i < this.children.length; i++) { | ||
if (c.seq >= core.length || bitfield.get(c.seq)) continue | ||
missing.push(c.seq) | ||
preloadBlock(core, c.seq) | ||
} | ||
if (missing.length) core.download({ blocks: missing }) | ||
} | ||
@@ -160,0 +162,0 @@ |
{ | ||
"name": "hyperbee", | ||
"version": "2.19.1", | ||
"version": "2.19.2", | ||
"description": "An append-only B-tree running on a Hypercore.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95687
2648