diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-07 21:13:11 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-07 21:13:11 +0800 |
commit | 0c9c5439d44990817dbba2323971993149da2cce (patch) | |
tree | 4b77244b1ce72160a1434036977c7a473781665c /cmd/utils | |
parent | 9e7d5d9d3b4ad686409fec7beb08792d38052a2c (diff) | |
parent | d673c34c8d4ae83a3765ed44ae9d0fb7ce1aa3c9 (diff) | |
download | go-tangerine-0c9c5439d44990817dbba2323971993149da2cce.tar go-tangerine-0c9c5439d44990817dbba2323971993149da2cce.tar.gz go-tangerine-0c9c5439d44990817dbba2323971993149da2cce.tar.bz2 go-tangerine-0c9c5439d44990817dbba2323971993149da2cce.tar.lz go-tangerine-0c9c5439d44990817dbba2323971993149da2cce.tar.xz go-tangerine-0c9c5439d44990817dbba2323971993149da2cce.tar.zst go-tangerine-0c9c5439d44990817dbba2323971993149da2cce.zip |
Merge branch 'release/0.9.36' into develop
Diffstat (limited to 'cmd/utils')
-rw-r--r-- | cmd/utils/flags.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index d58c754fe..903c97e71 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -369,6 +369,10 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config { clientID += "/" + customName } am := MakeAccountManager(ctx) + etherbase, err := ParamToAddress(ctx.GlobalString(EtherbaseFlag.Name), am) + if err != nil { + glog.V(logger.Error).Infoln("WARNING: No etherbase set and no accounts found as default") + } return ð.Config{ Name: common.MakeName(clientID, version), @@ -380,7 +384,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config { LogFile: ctx.GlobalString(LogFileFlag.Name), Verbosity: ctx.GlobalInt(VerbosityFlag.Name), LogJSON: ctx.GlobalString(LogJSONFlag.Name), - Etherbase: common.HexToAddress(ParamToAddress(ctx.GlobalString(EtherbaseFlag.Name), am)), + Etherbase: common.HexToAddress(etherbase), MinerThreads: ctx.GlobalInt(MinerThreadsFlag.Name), AccountManager: am, VmDebug: ctx.GlobalBool(VMDebugFlag.Name), @@ -508,7 +512,7 @@ func StartPProf(ctx *cli.Context) { }() } -func ParamToAddress(addr string, am *accounts.Manager) (addrHex string) { +func ParamToAddress(addr string, am *accounts.Manager) (addrHex string, err error) { if !((len(addr) == 40) || (len(addr) == 42)) { // with or without 0x index, err := strconv.Atoi(addr) if err != nil { @@ -517,7 +521,7 @@ func ParamToAddress(addr string, am *accounts.Manager) (addrHex string) { addrHex, err = am.AddressByIndex(index) if err != nil { - Fatalf("%v", err) + return "", err } } else { addrHex = addr |