diff --git a/packages/database/source/database-service.ts b/packages/database/source/database-service.ts index 356299479..a2e4ea48b 100644 --- a/packages/database/source/database-service.ts +++ b/packages/database/source/database-service.ts @@ -209,8 +209,7 @@ export class DatabaseService implements Contracts.Database.DatabaseService { return [...this.#commitCache.values()].pop()!; } - const height = this.blockIdStorage.getRange({ limit: 1, reverse: true }).asArray[0].value; - return await this.commitFactory.fromBytes(this.#readCommitBytes(height)!); + return await this.commitFactory.fromBytes(this.#readCommitBytes(this.#state.height)!); } public addCommit(commit: Contracts.Crypto.Commit): void {