Skip to content

Commit 080699f

Browse files
committed
cmd/swarm: ethapi not required
1 parent 8e35f54 commit 080699f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

cmd/swarm/main.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,11 @@ func registerBzzService(ctx *cli.Context, stack *node.Node) {
254254

255255
boot := func(ctx *node.ServiceContext) (node.Service, error) {
256256
var client *ethclient.Client
257-
if ethapi == "" {
258-
err = fmt.Errorf("use ethapi flag to connect to a an eth client and talk to the blockchain")
259-
} else {
257+
if len(ethapi) > 0 {
260258
client, err = ethclient.Dial(ethapi)
261-
}
262-
if err != nil {
263-
utils.Fatalf("Can't connect: %v", err)
259+
if err != nil {
260+
utils.Fatalf("Can't connect: %v", err)
261+
}
264262
}
265263
return swarm.NewSwarm(ctx, client, bzzconfig, swapEnabled, syncEnabled)
266264
}

0 commit comments

Comments
 (0)