Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak session #579

Open
wants to merge 2 commits into
base: rocksdb
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ module.exports = class Core {

const sharedLength = Math.min(treeLength, tree.length)

return new SessionState(this, storage, this.blocks, tree, bitfield, sharedLength, null, null)
return new SessionState(this, storage, this.blocks, tree, bitfield, sharedLength)
}

static async open (db, opts = {}) {
Expand Down Expand Up @@ -705,7 +705,9 @@ module.exports = class Core {

batch.nodes = srcNodes

if (this.header.tree.length < srcBatch.length) {
const ownLength = this.header.tree === null ? 0 : this.header.tree.length

if (ownLength < srcBatch.length) {
batch.upgraded = true
batch.length = srcBatch.length
batch.byteLength = srcBatch.byteLength
Expand Down
Loading