aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/main.go
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-04-03 03:14:25 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-05-12 23:19:39 +0800
commitda9fe951da4005761a014316c46771d628dc058e (patch)
treed5344172ed915b4890d66c3cf3b4181e30589471 /cmd/geth/main.go
parent6b23094cff77d7e485e0a2ae5698884f63c87ce7 (diff)
downloadgo-tangerine-da9fe951da4005761a014316c46771d628dc058e.tar
go-tangerine-da9fe951da4005761a014316c46771d628dc058e.tar.gz
go-tangerine-da9fe951da4005761a014316c46771d628dc058e.tar.bz2
go-tangerine-da9fe951da4005761a014316c46771d628dc058e.tar.lz
go-tangerine-da9fe951da4005761a014316c46771d628dc058e.tar.xz
go-tangerine-da9fe951da4005761a014316c46771d628dc058e.tar.zst
go-tangerine-da9fe951da4005761a014316c46771d628dc058e.zip
Use common.Address type for accounts.Address
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r--cmd/geth/main.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index 5fe83a2a0..dbcfe8175 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -365,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)
}
@@ -385,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)
}