Skip to content

Commit

Permalink
properly handle error
Browse files Browse the repository at this point in the history
  • Loading branch information
cam-schultz committed Jan 17, 2024
1 parent 58defa5 commit 1d9827e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions relayer/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,18 @@ func NewRelayer(
height, err := r.calculateStartingBlockHeight(sourceSubnetInfo.StartBlockHeight)
if err != nil {
logger.Error(
"Failed to process historical blocks mined during relayer downtime",
"Failed to calculate starting block height on startup",
zap.Error(err),
)
return nil, err
}
sub.ProcessFromHeight(big.NewInt(0).SetUint64(height))
err = sub.ProcessFromHeight(big.NewInt(0).SetUint64(height))
if err != nil {
logger.Error(
"Failed to process blocks from height on startup",
zap.Error(err),
)
return nil, err
} else {
err = r.setProcessedBlockHeightToLatest()
if err != nil {
Expand All @@ -183,6 +189,7 @@ func NewRelayer(
zap.String("blockchainID", r.sourceBlockchainID.String()),
zap.Error(err),
)
return nil, err
}
}

Expand Down

0 comments on commit 1d9827e

Please sign in to comment.