aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/swarm/main.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-02-22 23:22:50 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-02-23 18:16:46 +0800
commit1ca20a2697e5df840a0541b61f274379b43fddc7 (patch)
tree6fc5d566164c5fd960d91f0b88588d0688e715bd /cmd/swarm/main.go
parent23a5d64fd059bb8bdf02781608a15b8b1bdbdfd2 (diff)
downloaddexon-1ca20a2697e5df840a0541b61f274379b43fddc7.tar.gz
dexon-1ca20a2697e5df840a0541b61f274379b43fddc7.tar.zst
dexon-1ca20a2697e5df840a0541b61f274379b43fddc7.zip
cmd, whisper/mailserver: revert to utils.Fatalf
Diffstat (limited to 'cmd/swarm/main.go')
-rw-r--r--cmd/swarm/main.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go
index 84af69d7a..12cad328f 100644
--- a/cmd/swarm/main.go
+++ b/cmd/swarm/main.go
@@ -307,7 +307,7 @@ func registerBzzService(ctx *cli.Context, stack *node.Node) {
bzzconfig, err := bzzapi.NewConfig(bzzdir, chbookaddr, prvkey, ctx.GlobalUint64(SwarmNetworkIdFlag.Name))
if err != nil {
- log.Crit(fmt.Sprintf("unable to configure swarm: %v", err))
+ utils.Fatalf("unable to configure swarm: %v", err)
}
bzzport := ctx.GlobalString(SwarmPortFlag.Name)
if len(bzzport) > 0 {
@@ -324,13 +324,13 @@ func registerBzzService(ctx *cli.Context, stack *node.Node) {
if len(ethapi) > 0 {
client, err = ethclient.Dial(ethapi)
if err != nil {
- log.Crit(fmt.Sprintf("Can't connect: %v", err))
+ utils.Fatalf("Can't connect: %v", err)
}
}
return swarm.NewSwarm(ctx, client, bzzconfig, swapEnabled, syncEnabled, cors)
}
if err := stack.Register(boot); err != nil {
- log.Crit(fmt.Sprintf("Failed to register the Swarm service: %v", err))
+ utils.Fatalf("Failed to register the Swarm service: %v", err)
}
}
@@ -338,7 +338,7 @@ func getAccount(ctx *cli.Context, stack *node.Node) *ecdsa.PrivateKey {
keyid := ctx.GlobalString(SwarmAccountFlag.Name)
if keyid == "" {
- log.Crit(fmt.Sprintf("Option %q is required", SwarmAccountFlag.Name))
+ utils.Fatalf("Option %q is required", SwarmAccountFlag.Name)
}
// Try to load the arg as a hex key file.
if key, err := crypto.LoadECDSA(keyid); err == nil {
@@ -364,14 +364,14 @@ func decryptStoreAccount(ks *keystore.KeyStore, account string) *ecdsa.PrivateKe
err = fmt.Errorf("index %d higher than number of accounts %d", ix, len(accounts))
}
} else {
- log.Crit(fmt.Sprintf("Can't find swarm account key %s", account))
+ utils.Fatalf("Can't find swarm account key %s", account)
}
if err != nil {
- log.Crit(fmt.Sprintf("Can't find swarm account key: %v", err))
+ utils.Fatalf("Can't find swarm account key: %v", err)
}
keyjson, err := ioutil.ReadFile(a.URL.Path)
if err != nil {
- log.Crit(fmt.Sprintf("Can't load swarm account key: %v", err))
+ utils.Fatalf("Can't load swarm account key: %v", err)
}
for i := 1; i <= 3; i++ {
passphrase := promptPassphrase(fmt.Sprintf("Unlocking swarm account %s [%d/3]", a.Address.Hex(), i))
@@ -380,7 +380,7 @@ func decryptStoreAccount(ks *keystore.KeyStore, account string) *ecdsa.PrivateKe
return key.PrivateKey
}
}
- log.Crit(fmt.Sprintf("Can't decrypt swarm account key"))
+ utils.Fatalf("Can't decrypt swarm account key")
return nil
}
@@ -390,7 +390,7 @@ func promptPassphrase(prompt string) string {
}
password, err := console.Stdin.PromptPassword("Passphrase: ")
if err != nil {
- log.Crit(fmt.Sprintf("Failed to read passphrase: %v", err))
+ utils.Fatalf("Failed to read passphrase: %v", err)
}
return password
}