hypercore
Advanced tools
Comparing version 11.0.4 to 11.0.5
@@ -344,10 +344,10 @@ const { EventEmitter } = require('events') | ||
const checkout = opts.checkout === undefined ? -1 : opts.checkout | ||
const state = this.state | ||
if (opts.atom) { | ||
this.state = await parent.state.createSession(null, checkout, false, opts.atom) | ||
if (state) state.unref() | ||
} else if (opts.name) { | ||
// todo: need to make named sessions safe before ready | ||
// atm we always copy the state in passCapabilities | ||
const state = this.state | ||
this.state = await parent.state.createSession(opts.name, checkout, !!opts.overwrite, null) | ||
@@ -354,0 +354,0 @@ if (state) state.unref() // ref'ed above in setup session |
@@ -244,2 +244,4 @@ const crypto = require('hypercore-crypto') | ||
this._moveToCore(src.core) | ||
await this.storage.close() | ||
} | ||
@@ -802,4 +804,5 @@ | ||
if (!this.isSnapshot()) { | ||
const oldStorage = this.storage | ||
const truncation = length < this.length ? await truncateAndFlush(this, length) : null | ||
const treeInfo = truncation ? truncation.tree : await state._getTreeHeadAt(this.length) | ||
@@ -832,2 +835,4 @@ | ||
} | ||
await oldStorage.close() | ||
} | ||
@@ -834,0 +839,0 @@ |
{ | ||
"name": "hypercore", | ||
"version": "11.0.4", | ||
"version": "11.0.5", | ||
"description": "Hypercore is a secure, distributed append-only log", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
283568
8048