Commit abbdf415 authored by zelig's avatar zelig

output error message if unlock address is invalid (fixes the wierd "read...

output error message if unlock address is invalid (fixes the wierd "read /path: is a directory") msg
parent 11d2ebc0
......@@ -295,7 +295,11 @@ func unlockAccount(ctx *cli.Context, am *accounts.Manager, account string) (pass
// Load startup keys. XXX we are going to need a different format
// Attempt to unlock the account
passphrase = getPassPhrase(ctx, "", false)
err = am.Unlock(common.FromHex(account), passphrase)
accbytes := common.FromHex(account)
if len(accbytes) == 0 {
utils.Fatalf("Invalid account address '%s'", account)
}
err = am.Unlock(accbytes, passphrase)
if err != nil {
utils.Fatalf("Unlock account failed '%v'", err)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment