From ee1682ffe6728618cc4458f3923a4c46fff64d98 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 18 Mar 2016 01:35:03 +0100 Subject: cmd/geth: add tests for account commands --- cmd/geth/accountcmd.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmd/geth/accountcmd.go') 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) -- cgit v1.2.3