cmd/geth: print actual error when --unlock fails

This commit is contained in:
Felix Lange
2016-03-30 22:58:08 +02:00
parent 549f1add29
commit aca9d6a1fb
2 changed files with 4 additions and 4 deletions

View File

@ -181,13 +181,13 @@ func unlockAccount(ctx *cli.Context, accman *accounts.Manager, address string, i
for trials := 0; trials < 3; trials++ {
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 {
if err = accman.Unlock(account, password); err == nil {
glog.V(logger.Info).Infof("Unlocked account %x", account.Address)
return account, password
}
}
// All trials expended to unlock account, bail out
utils.Fatalf("Failed to unlock account: %s", address)
utils.Fatalf("Failed to unlock account %s (%v)", address, err)
return accounts.Account{}, ""
}