From b7511638ba5cb4c4f2fd51aa18b8164bf27ab911 Mon Sep 17 00:00:00 2001 From: Matthieu Moquet Date: Thu, 18 Jan 2024 18:04:05 +0100 Subject: [PATCH] fix: allow starting with no node synced --- pkg/app/run.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/app/run.go b/pkg/app/run.go index 68414ae..1acba96 100644 --- a/pkg/app/run.go +++ b/pkg/app/run.go @@ -206,7 +206,7 @@ func logLevelFromString(level string) zerolog.Level { func createNodePool(ctx context.Context, nodes []string) (*rpc.Pool, error) { rpcNodes := make([]*rpc.Node, len(nodes)) for i, endpoint := range nodes { - ctx, cancel := context.WithTimeout(ctx, 5*time.Second) + ctx, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() client, err := http.New(endpoint, "/websocket") @@ -234,7 +234,6 @@ func createNodePool(ctx context.Context, nodes []string) (*rpc.Pool, error) { } } - var rpcNode *rpc.Node var chainID string for _, node := range rpcNodes { if chainID == "" { @@ -242,12 +241,6 @@ func createNodePool(ctx context.Context, nodes []string) (*rpc.Pool, error) { } else if chainID != node.ChainID() && node.ChainID() != "" { return nil, fmt.Errorf("nodes are on different chains: %s != %s", chainID, node.ChainID()) } - if node.IsSynced() { - rpcNode = node - } - } - if rpcNode == nil { - return nil, fmt.Errorf("no nodes synced") } return rpc.NewPool(chainID, rpcNodes), nil