Skip to content

Commit 7b1c62f

Browse files
committed
fix: skip nodes if not dialable
1 parent d8d8a88 commit 7b1c62f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cmd/filsnap/cmds/create.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ package cmds
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"io"
78
"io/ioutil"
9+
"syscall"
810
"time"
911

1012
"github.com/filecoin-project/go-state-types/abi"
@@ -153,6 +155,11 @@ var cmdCreate = &cli.Command{
153155
for _, addr := range addrs {
154156
node, closer, err := CreateLotusClient(ctx, addr)
155157
if err != nil {
158+
if errors.Is(err, syscall.ECONNREFUSED) {
159+
logger.Warnw("failed to dial node", "err", err)
160+
continue
161+
}
162+
156163
return err
157164
}
158165

@@ -161,6 +168,10 @@ var cmdCreate = &cli.Command{
161168
nodes = append(nodes, node)
162169
}
163170

171+
if len(nodes) == 0 {
172+
return xerrors.Errorf("no nodes")
173+
}
174+
164175
cm := consensus.NewConsensusManager(nodes)
165176

166177
same, err := cm.CheckGenesis(ctx)

0 commit comments

Comments
 (0)