Skip to content

Commit

Permalink
use #state.height
Browse files Browse the repository at this point in the history
  • Loading branch information
oXtxNt9U committed Dec 13, 2024
1 parent 425ea12 commit 582666a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/database/source/database-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 582666a

Please sign in to comment.