aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/accountcmd.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/geth/accountcmd.go')
-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)
}