diff options
author | Felix Lange <fjl@twurst.com> | 2016-03-18 08:35:03 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-04-12 21:58:07 +0800 |
commit | ee1682ffe6728618cc4458f3923a4c46fff64d98 (patch) | |
tree | caec157398877dd792223a487f527fe8ce5076ad /cmd/geth/accountcmd.go | |
parent | 6cb08d8328a242a8def4d432904b1c112ebd823f (diff) | |
download | dexon-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.go | 7 |
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) |