Skip to content

Commit

Permalink
fix: reset lastqueried block if provider returns smaller value
Browse files Browse the repository at this point in the history
  • Loading branch information
bcsainju committed Aug 12, 2024
1 parent d180ade commit 24949d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions relayer/chains/wasm/wasm_chain_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,13 @@ func (ccp *WasmChainProcessor) queryCycle(ctx context.Context, persistence *quer
zap.Int64("delta", delta))
persistence.latestHeight = status.SyncInfo.LatestBlockHeight
heighttoSync = syncUpHeight()
if persistence.latestQueriedBlock > status.SyncInfo.LatestBlockHeight {
ccp.log.Debug("resetting range block",
zap.Int64("last_height", persistence.latestQueriedBlock),
zap.Int64("latest_height", status.SyncInfo.LatestBlockHeight))
persistence.latestQueriedBlock = status.SyncInfo.LatestBlockHeight
return nil
}
if (persistence.latestQueriedBlock + 1) >= persistence.latestHeight {
return nil
}
Expand Down

0 comments on commit 24949d4

Please sign in to comment.