Skip to content

Commit

Permalink
fix inconsistent page size
Browse files Browse the repository at this point in the history
  • Loading branch information
voliva committed Oct 16, 2024
1 parent d2d48fb commit 0795952
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/core/src/rpc/rpc-spec/chainHead_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ async function getDescendantValues(
}>
next: DescendantValuesParams | null
}> {
const pageSize = 100
const keys = await block.getKeysPaged({
...params,
pageSize: PAGE_SIZE,
Expand All @@ -202,7 +201,7 @@ async function getDescendantValues(
),
)

if (keys.length < pageSize) {
if (keys.length < PAGE_SIZE) {
return {
items,
next: null,
Expand All @@ -213,7 +212,7 @@ async function getDescendantValues(
items,
next: {
...params,
startKey: keys[pageSize - 1],
startKey: keys[PAGE_SIZE - 1],
},
}
}
Expand Down

0 comments on commit 0795952

Please sign in to comment.