hypercore 11.27.11 → 11.27.12
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/index.js +5 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -188,6 +188,11 @@ class Hypercore extends EventEmitter {
|
|
|
188
188
|
return Replicator.clearRequests(session, err)
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
static async treeHashFromStorage(session, length = session.length) {
|
|
192
|
+
const roots = await MerkleTree.getRoots(session.state, length)
|
|
193
|
+
return crypto.tree(roots)
|
|
194
|
+
}
|
|
195
|
+
|
|
191
196
|
snapshot(opts) {
|
|
192
197
|
return this.session({ ...opts, snapshot: true })
|
|
193
198
|
}
|