aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2015-03-25 23:45:56 +0800
committerzelig <viktor.tron@gmail.com>2015-03-27 03:00:18 +0800
commit11d2ebc06ffffa8846d5d55cae5663fac6f685f1 (patch)
treeb8be3aaf5d35bd8a87f0468bd051a16e485a3ae0 /cmd
parent4ec38e39320ee9abccd96da765a9c65fccd04151 (diff)
downloadgo-tangerine-11d2ebc06ffffa8846d5d55cae5663fac6f685f1.tar
go-tangerine-11d2ebc06ffffa8846d5d55cae5663fac6f685f1.tar.gz
go-tangerine-11d2ebc06ffffa8846d5d55cae5663fac6f685f1.tar.bz2
go-tangerine-11d2ebc06ffffa8846d5d55cae5663fac6f685f1.tar.lz
go-tangerine-11d2ebc06ffffa8846d5d55cae5663fac6f685f1.tar.xz
go-tangerine-11d2ebc06ffffa8846d5d55cae5663fac6f685f1.tar.zst
go-tangerine-11d2ebc06ffffa8846d5d55cae5663fac6f685f1.zip
unlocking coinbase without knowing address
- accounts: remove Manager.getKey - cli: for -unlock coinbase, use account manager Coinbase()
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ethereum/main.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go
index 6bbe1044f..8983b85a6 100644
--- a/cmd/ethereum/main.go
+++ b/cmd/ethereum/main.go
@@ -294,7 +294,7 @@ func unlockAccount(ctx *cli.Context, am *accounts.Manager, account string) (pass
var err error
// Load startup keys. XXX we are going to need a different format
// Attempt to unlock the account
- passphrase := getPassPhrase(ctx, "", false)
+ passphrase = getPassPhrase(ctx, "", false)
err = am.Unlock(common.FromHex(account), passphrase)
if err != nil {
utils.Fatalf("Unlock account failed '%v'", err)
@@ -310,7 +310,11 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
account := ctx.GlobalString(utils.UnlockedAccountFlag.Name)
if len(account) > 0 {
if account == "coinbase" {
- account = ""
+ accbytes, err := am.Coinbase()
+ if err != nil {
+ utils.Fatalf("no coinbase account: %v", err)
+ }
+ account = common.ToHex(accbytes)
}
unlockAccount(ctx, am, account)
}
@@ -420,6 +424,7 @@ func accountExport(ctx *cli.Context) {
}
am := utils.GetAccountManager(ctx)
auth := unlockAccount(ctx, am, account)
+
err := am.Export(keyfile, common.FromHex(account), auth)
if err != nil {
utils.Fatalf("Account export failed: %v", err)