aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2016-12-13 17:52:22 +0800
committerzelig <viktor.tron@gmail.com>2016-12-13 19:54:13 +0800
commit080699f7df86f472a99d181c46605391dfd99967 (patch)
tree6620ed748ce9b8c816bbef1c7627a10c74ff88a5 /cmd
parent8e35f54931a0c5036d82f7b7db756d70290cf118 (diff)
downloadgo-tangerine-080699f7df86f472a99d181c46605391dfd99967.tar.gz
go-tangerine-080699f7df86f472a99d181c46605391dfd99967.tar.zst
go-tangerine-080699f7df86f472a99d181c46605391dfd99967.zip
cmd/swarm: ethapi not required
Diffstat (limited to 'cmd')
-rw-r--r--cmd/swarm/main.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go
index e968ad4c2..144dcc80c 100644
--- a/cmd/swarm/main.go
+++ b/cmd/swarm/main.go
@@ -254,13 +254,11 @@ func registerBzzService(ctx *cli.Context, stack *node.Node) {
boot := func(ctx *node.ServiceContext) (node.Service, error) {
var client *ethclient.Client
- if ethapi == "" {
- err = fmt.Errorf("use ethapi flag to connect to a an eth client and talk to the blockchain")
- } else {
+ if len(ethapi) > 0 {
client, err = ethclient.Dial(ethapi)
- }
- if err != nil {
- utils.Fatalf("Can't connect: %v", err)
+ if err != nil {
+ utils.Fatalf("Can't connect: %v", err)
+ }
}
return swarm.NewSwarm(ctx, client, bzzconfig, swapEnabled, syncEnabled)
}