Skip to content

Commit

Permalink
chore: enable the interval to be updated
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler committed Nov 14, 2024
1 parent 7e02da9 commit 29ca794
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions integrations/tendermint-ssync/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@ export default class TendermintSSync implements IRuntime {
// move on to next snapshot and start at first chunk
// if we have already reached all chunks in current snapshot
if (snapshot.chunks - 1 === chunkIndex) {
// since the interval can change and the cosmos apps always create
// snapshots if the block height is divisible by the interval we
// search for the next height which fits this definition
for (let h = height + 1; h <= height + this.config.interval; h++) {
if (h % this.config.interval === 0) {
return `${h}/0`;
}
}

return `${height + this.config.interval}/0`;
}

Expand Down

0 comments on commit 29ca794

Please sign in to comment.