diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-22 23:22:50 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-02-23 18:16:46 +0800 |
commit | 1ca20a2697e5df840a0541b61f274379b43fddc7 (patch) | |
tree | 6fc5d566164c5fd960d91f0b88588d0688e715bd /cmd/bootnode/main.go | |
parent | 23a5d64fd059bb8bdf02781608a15b8b1bdbdfd2 (diff) | |
download | go-tangerine-1ca20a2697e5df840a0541b61f274379b43fddc7.tar.gz go-tangerine-1ca20a2697e5df840a0541b61f274379b43fddc7.tar.zst go-tangerine-1ca20a2697e5df840a0541b61f274379b43fddc7.zip |
cmd, whisper/mailserver: revert to utils.Fatalf
Diffstat (limited to 'cmd/bootnode/main.go')
-rw-r--r-- | cmd/bootnode/main.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/cmd/bootnode/main.go b/cmd/bootnode/main.go index 31b2726be..c3fc163a1 100644 --- a/cmd/bootnode/main.go +++ b/cmd/bootnode/main.go @@ -23,6 +23,7 @@ import ( "fmt" "os" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p/discover" @@ -56,28 +57,28 @@ func main() { natm, err := nat.Parse(*natdesc) if err != nil { - log.Crit("Failed to parse requested NAT", "error", err) + utils.Fatalf("-nat: %v", err) } switch { case *genKey != "": nodeKey, err = crypto.GenerateKey() if err != nil { - log.Crit("Failed to generate new key", "error", err) + utils.Fatalf("could not generate key: %v", err) } if err = crypto.SaveECDSA(*genKey, nodeKey); err != nil { - log.Crit("Failed to save generated key", "error", err) + utils.Fatalf("%v", err) } case *nodeKeyFile == "" && *nodeKeyHex == "": - log.Crit("Use -nodekey or -nodekeyhex to load a private key") + utils.Fatalf("Use -nodekey or -nodekeyhex to specify a private key") case *nodeKeyFile != "" && *nodeKeyHex != "": - log.Crit("Options -nodekey and -nodekeyhex are mutually exclusive") + utils.Fatalf("Options -nodekey and -nodekeyhex are mutually exclusive") case *nodeKeyFile != "": if nodeKey, err = crypto.LoadECDSA(*nodeKeyFile); err != nil { - log.Crit("Failed to loading the key file", "path", *nodeKeyFile, "error", err) + utils.Fatalf("-nodekey: %v", err) } case *nodeKeyHex != "": if nodeKey, err = crypto.HexToECDSA(*nodeKeyHex); err != nil { - log.Crit("Failed to parse the key hex", "hex", *nodeKeyHex, "error", err) + utils.Fatalf("-nodekeyhex: %v", err) } } @@ -90,17 +91,17 @@ func main() { if *netrestrict != "" { restrictList, err = netutil.ParseNetlist(*netrestrict) if err != nil { - log.Crit("Failed to parse the network restrictions", "error", err) + utils.Fatalf("-netrestrict: %v", err) } } if *runv5 { if _, err := discv5.ListenUDP(nodeKey, *listenAddr, natm, "", restrictList); err != nil { - log.Crit("Failed to start the v5 discovery protocol", "error", err) + utils.Fatalf("%v", err) } } else { if _, err := discover.ListenUDP(nodeKey, *listenAddr, natm, "", restrictList); err != nil { - log.Crit("Failed to start the discovery protocol", "error", err) + utils.Fatalf("%v", err) } } |