Skip to content

Commit 94dbc60

Browse files
committed
fix: block repository logic
1 parent 52c081a commit 94dbc60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

indexer/src/kadena-server/repository/infra/repository/block-db-repository.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export default class BlockDbRepository implements BlockRepository {
160160
conditions += `\nAND b."chainId" = ANY($${queryParams.length})`;
161161
}
162162

163-
if (endHeight && endHeight - startHeight < 20) {
163+
if (endHeight) {
164164
queryParams.push(endHeight);
165165
conditions += `\nAND b."height" <= $${queryParams.length}`;
166166
}
@@ -182,7 +182,7 @@ export default class BlockDbRepository implements BlockRepository {
182182
FROM "Blocks" b
183183
WHERE b.height >= $2
184184
${conditions}
185-
ORDER BY b.height ${order}
185+
ORDER BY b.height, b.id ${order}
186186
LIMIT $1;
187187
`;
188188

0 commit comments

Comments
 (0)