diff options
author | obscuren <geffobscura@gmail.com> | 2015-05-13 01:05:33 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-05-13 01:05:33 +0800 |
commit | 8e24378cc1acb074b56de75bf0baf6feb7927677 (patch) | |
tree | 71f866652de6b45da5ad4403b88f5def9a684e36 /cmd/geth/main.go | |
parent | 7d69679935ff8c04aebb60f27074f08c5e84ac95 (diff) | |
parent | 8fe01b4bfa28ad5a1fdde7f9837e8f982843389a (diff) | |
download | go-tangerine-8e24378cc1acb074b56de75bf0baf6feb7927677.tar go-tangerine-8e24378cc1acb074b56de75bf0baf6feb7927677.tar.gz go-tangerine-8e24378cc1acb074b56de75bf0baf6feb7927677.tar.bz2 go-tangerine-8e24378cc1acb074b56de75bf0baf6feb7927677.tar.lz go-tangerine-8e24378cc1acb074b56de75bf0baf6feb7927677.tar.xz go-tangerine-8e24378cc1acb074b56de75bf0baf6feb7927677.tar.zst go-tangerine-8e24378cc1acb074b56de75bf0baf6feb7927677.zip |
Merge branch 'release/0.9.20'v0.9.20
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r-- | cmd/geth/main.go | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index fd7aae4c2..1582953f7 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -26,7 +26,6 @@ import ( "io" "io/ioutil" "os" - "path" "path/filepath" "runtime" "strconv" @@ -51,7 +50,7 @@ import _ "net/http/pprof" const ( ClientIdentifier = "Geth" - Version = "0.9.19" + Version = "0.9.20" ) var ( @@ -366,11 +365,10 @@ func unlockAccount(ctx *cli.Context, am *accounts.Manager, account string) (pass // Load startup keys. XXX we are going to need a different format // Attempt to unlock the account passphrase = getPassPhrase(ctx, "", false) - accbytes := common.FromHex(account) - if len(accbytes) == 0 { + if len(account) == 0 { utils.Fatalf("Invalid account address '%s'", account) } - err = am.Unlock(accbytes, passphrase) + err = am.Unlock(common.StringToAddress(account), passphrase) if err != nil { utils.Fatalf("Unlock account failed '%v'", err) } @@ -386,11 +384,11 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) { account := ctx.GlobalString(utils.UnlockedAccountFlag.Name) if len(account) > 0 { if account == "primary" { - accbytes, err := am.Primary() + primaryAcc, err := am.Primary() if err != nil { utils.Fatalf("no primary account: %v", err) } - account = common.ToHex(accbytes) + account = primaryAcc.Hex() } unlockAccount(ctx, am, account) } @@ -401,7 +399,7 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) { } } if ctx.GlobalBool(utils.MiningEnabledFlag.Name) { - if err := eth.StartMining(); err != nil { + if err := eth.StartMining(ctx.GlobalInt(utils.MinerThreadsFlag.Name)); err != nil { utils.Fatalf("%v", err) } } @@ -565,7 +563,7 @@ func upgradeDb(ctx *cli.Context) { } filename := fmt.Sprintf("blockchain_%d_%s.chain", bcVersion, time.Now().Format("2006-01-02_15:04:05")) - exportFile := path.Join(ctx.GlobalString(utils.DataDirFlag.Name), filename) + exportFile := filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), filename) err = utils.ExportChain(ethereum.ChainManager(), exportFile) if err != nil { @@ -576,7 +574,7 @@ func upgradeDb(ctx *cli.Context) { ethereum.StateDb().Close() ethereum.ExtraDb().Close() - os.RemoveAll(path.Join(ctx.GlobalString(utils.DataDirFlag.Name), "blockchain")) + os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "blockchain")) ethereum, err = eth.New(cfg) if err != nil { |