From 11d4bee957714766290fc3f2a4c087cb73393672 Mon Sep 17 00:00:00 2001 From: Matt Ketmo Date: Tue, 26 Sep 2023 10:19:01 +0200 Subject: [PATCH] fix: ignore fail to fetch latest block on node start (#28) --- pkg/watcher/block.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/watcher/block.go b/pkg/watcher/block.go index eb85498..d450fcd 100644 --- a/pkg/watcher/block.go +++ b/pkg/watcher/block.go @@ -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 {