Skip to content

Commit 9d25560

Browse files
copyFrom sets fork before creating batch
1 parent 3081b42 commit 9d25560

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/core.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ module.exports = class Core {
279279

280280
await this.tree.flush()
281281

282+
this.tree.fork = fork
283+
282284
let batch = this.tree.batch()
283285

284286
// add additional blocks
@@ -334,9 +336,8 @@ module.exports = class Core {
334336

335337
await batch.commit()
336338

337-
this.tree.fork = fork
338-
339339
this.header.tree.length = this.tree.length
340+
this.header.tree.fork = this.tree.fork
340341
this.header.tree.rootHash = this.tree.hash()
341342
this.header.tree.signature = this.tree.signature
342343

0 commit comments

Comments
 (0)