Skip to content

Commit

Permalink
If lastCheckedBlockheight is zero, Set it to height at which peggy co…
Browse files Browse the repository at this point in the history
…ntract is deployed
  • Loading branch information
mankenavenkatesh committed Jun 30, 2021
1 parent 94d0f48 commit bb7b5f1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions orchestrator/main_loops.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ func (s *peggyOrchestrator) EthOracleMainLoop(ctx context.Context) (err error) {

if err := retry.Do(func() (err error) {
lastCheckedBlock, err = s.GetLastCheckedBlock(ctx)
if lastCheckedBlock == 0 {
peggyParams, err := s.cosmosQueryClient.PeggyParams(ctx)
if err != nil {
log.WithError(err).Fatalln("failed to query peggy params, is injectived running?")
}
lastCheckedBlock = peggyParams.BridgeContractStartHeight
}
return
}, retry.Context(ctx), retry.OnRetry(func(n uint, err error) {
logger.WithError(err).Warningf("failed to get last checked block, will retry (%d)", n)
Expand Down

0 comments on commit bb7b5f1

Please sign in to comment.