Skip to content

Commit 88e5f03

Browse files
committed
client -> vm execution: fixed firstBlock number and hash association on execution log msg output
1 parent 838d6c4 commit 88e5f03

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/client/lib/sync/fullsync.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,17 @@ export class FullSynchronizer extends Synchronizer {
7171
let oldHead = Buffer.alloc(0)
7272
const newHeadBlock = await this.vm.blockchain.getHead()
7373
let newHead = newHeadBlock.hash()
74-
const firstHeadBlock = newHeadBlock
74+
let firstHeadBlock = newHeadBlock
7575
let lastHeadBlock = newHeadBlock
7676
while (!newHead.equals(oldHead) && !this.stopSyncing) {
7777
oldHead = newHead
7878
this.vmPromise = this.vm.runBlockchain(this.vm.blockchain, 1)
7979
await this.vmPromise
8080
const headBlock = await this.vm.blockchain.getHead()
8181
newHead = headBlock.hash()
82+
if (blockCounter === 0) {
83+
firstHeadBlock = headBlock
84+
}
8285
// check if we did run a new block:
8386
if (!newHead.equals(oldHead)) {
8487
blockCounter += 1

0 commit comments

Comments
 (0)