aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/accountcmd.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-03-18 08:35:03 +0800
committerFelix Lange <fjl@twurst.com>2016-04-12 21:58:07 +0800
commitee1682ffe6728618cc4458f3923a4c46fff64d98 (patch)
treecaec157398877dd792223a487f527fe8ce5076ad /cmd/geth/accountcmd.go
parent6cb08d8328a242a8def4d432904b1c112ebd823f (diff)
downloaddexon-ee1682ffe6728618cc4458f3923a4c46fff64d98.tar
dexon-ee1682ffe6728618cc4458f3923a4c46fff64d98.tar.gz
dexon-ee1682ffe6728618cc4458f3923a4c46fff64d98.tar.bz2
dexon-ee1682ffe6728618cc4458f3923a4c46fff64d98.tar.lz
dexon-ee1682ffe6728618cc4458f3923a4c46fff64d98.tar.xz
dexon-ee1682ffe6728618cc4458f3923a4c46fff64d98.tar.zst
dexon-ee1682ffe6728618cc4458f3923a4c46fff64d98.zip
cmd/geth: add tests for account commands
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 b4c37cb86..18265f251 100644
--- a/cmd/geth/accountcmd.go
+++ b/cmd/geth/accountcmd.go
@@ -23,6 +23,8 @@ import (
"github.com/codegangsta/cli"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/cmd/utils"
+ "github.com/ethereum/go-ethereum/logger"
+ "github.com/ethereum/go-ethereum/logger/glog"
)
var (
@@ -180,6 +182,7 @@ func unlockAccount(ctx *cli.Context, accman *accounts.Manager, address string, i
prompt := fmt.Sprintf("Unlocking account %s | Attempt %d/%d", address, trials+1, 3)
password := getPassPhrase(prompt, false, i, passwords)
if err := accman.Unlock(account, password); err == nil {
+ glog.V(logger.Info).Infof("Unlocked account %x", account.Address)
return account, password
}
}
@@ -199,7 +202,9 @@ func getPassPhrase(prompt string, confirmation bool, i int, passwords []string)
return passwords[len(passwords)-1]
}
// Otherwise prompt the user for the password
- fmt.Println(prompt)
+ if prompt != "" {
+ fmt.Println(prompt)
+ }
password, err := utils.Stdin.PasswordPrompt("Passphrase: ")
if err != nil {
utils.Fatalf("Failed to read passphrase: %v", err)