aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-04-05 07:08:50 +0800
committerFelix Lange <fjl@twurst.com>2016-04-12 21:59:18 +0800
commit46df50be181afca503aff4a545e3f322ad04448b (patch)
treec969c79d6512bf1af4206c057497c23664bd131e /cmd
parent91aaddaeb38ff25118896fb436a938d14636760b (diff)
downloadgo-tangerine-46df50be181afca503aff4a545e3f322ad04448b.tar
go-tangerine-46df50be181afca503aff4a545e3f322ad04448b.tar.gz
go-tangerine-46df50be181afca503aff4a545e3f322ad04448b.tar.bz2
go-tangerine-46df50be181afca503aff4a545e3f322ad04448b.tar.lz
go-tangerine-46df50be181afca503aff4a545e3f322ad04448b.tar.xz
go-tangerine-46df50be181afca503aff4a545e3f322ad04448b.tar.zst
go-tangerine-46df50be181afca503aff4a545e3f322ad04448b.zip
accounts: improve API and add documentation
- Sign takes common.Address, not Account - Import/Export methods work with encrypted JSON keys
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/accountcmd.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go
index 0bd60d701..bf754c72f 100644
--- a/cmd/geth/accountcmd.go
+++ b/cmd/geth/accountcmd.go
@@ -23,6 +23,7 @@ import (
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/cmd/utils"
+ "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
)
@@ -308,9 +309,13 @@ func accountImport(ctx *cli.Context) {
if len(keyfile) == 0 {
utils.Fatalf("keyfile must be given as argument")
}
+ key, err := crypto.LoadECDSA(keyfile)
+ if err != nil {
+ utils.Fatalf("keyfile must be given as argument")
+ }
accman := utils.MakeAccountManager(ctx)
passphrase := getPassPhrase("Your new account is locked with a password. Please give a password. Do not forget this password.", true, 0, utils.MakePasswordList(ctx))
- acct, err := accman.Import(keyfile, passphrase)
+ acct, err := accman.ImportECDSA(key, passphrase)
if err != nil {
utils.Fatalf("Could not create the account: %v", err)
}