diff --git a/packages/blockchain/src/blockchain.ts b/packages/blockchain/src/blockchain.ts index d2d3c5d5a3d..b869b9c7ec0 100644 --- a/packages/blockchain/src/blockchain.ts +++ b/packages/blockchain/src/blockchain.ts @@ -378,7 +378,12 @@ export class Blockchain implements BlockchainInterface { ) } - if (this._validateBlocks && !isGenesis && item instanceof Block && optimisticOpts === undefined) { + if ( + this._validateBlocks && + !isGenesis && + item instanceof Block && + optimisticOpts === undefined + ) { // this calls into `getBlock`, which is why we cannot lock yet await this.validateBlock(block) } diff --git a/packages/client/test/sync/skeleton.spec.ts b/packages/client/test/sync/skeleton.spec.ts index b55bdff7086..383a0b17859 100644 --- a/packages/client/test/sync/skeleton.spec.ts +++ b/packages/client/test/sync/skeleton.spec.ts @@ -242,6 +242,7 @@ describe('[Skeleton] / initSync', async () => { storageCache: 1000, }) const chain = await Chain.create({ config }) + ;(chain.blockchain as any)._validateBlocks = false const skeleton = new Skeleton({ chain, config, metaDB: new MemoryLevel() }) await skeleton.open() @@ -359,6 +360,7 @@ describe('[Skeleton] / setHead', async () => { storageCache: 1000, }) const chain = await Chain.create({ config }) + ;(chain.blockchain as any)._validateBlocks = false const skeleton = new Skeleton({ chain, config, metaDB: new MemoryLevel() }) await skeleton.open() for (const block of testCase.blocks ?? []) {