diff --git a/packages/database/source/database-service.ts b/packages/database/source/database-service.ts index b9f11cd54..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 = Number(this.commitStorage.getRange({ limit: 1, reverse: true }).asArray[0].key); - 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 {