Skip to content

Commit

Permalink
fix: ignore fail to fetch latest block on node start (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKetmo authored Sep 26, 2023
1 parent 2e879e2 commit 11d4bee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/watcher/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ func (w *BlockWatcher) OnNodeStart(ctx context.Context, n *rpc.Node) error {

block, err := n.Client.Block(ctx, nil)
if err != nil {
return fmt.Errorf("failed to get latest block: %w", err)
log.Warn().Err(err).Msg("failed to get latest block")
} else {
w.blockChan <- w.enchanceBlock(block.Block, validators)
}
w.blockChan <- w.enchanceBlock(block.Block, validators)

go func() {
for {
Expand Down

0 comments on commit 11d4bee

Please sign in to comment.