From 582666abf5737fb1e5a056b55f07fcee888b1bcf Mon Sep 17 00:00:00 2001 From: oXtxNt9U <120286271+oXtxNt9U@users.noreply.github.com> Date: Fri, 13 Dec 2024 19:12:09 +0900 Subject: [PATCH] use #state.height --- packages/database/source/database-service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 {