Skip to content

Commit

Permalink
fix: select checkpoint blocks by distinct (#277)
Browse files Browse the repository at this point in the history
If there are multiple contracts checkpointed at same block, this block
can then be processed multiple times causing issues.
  • Loading branch information
Sekhmet authored Jan 23, 2024
1 parent 1908038 commit 5f26d27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stores/checkpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class CheckpointsStore {
limit = 15
): Promise<number[]> {
const result = await this.knex
.select(Fields.Checkpoints.BlockNumber)
.distinct(Fields.Checkpoints.BlockNumber)
.from(Table.Checkpoints)
.where(Fields.Checkpoints.BlockNumber, '>=', block)
.whereIn(Fields.Checkpoints.ContractAddress, contracts)
Expand Down

0 comments on commit 5f26d27

Please sign in to comment.