aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2015-03-26 00:10:44 +0800
committerzelig <viktor.tron@gmail.com>2015-03-27 03:00:18 +0800
commitabbdf4156057de8a4f866b0840defc00c2c500db (patch)
tree852b930c2037bb6755ee0f0b0fb7d519c6f8ecf8 /cmd
parent11d2ebc06ffffa8846d5d55cae5663fac6f685f1 (diff)
downloadgo-tangerine-abbdf4156057de8a4f866b0840defc00c2c500db.tar.gz
go-tangerine-abbdf4156057de8a4f866b0840defc00c2c500db.tar.zst
go-tangerine-abbdf4156057de8a4f866b0840defc00c2c500db.zip
output error message if unlock address is invalid (fixes the wierd "read /path: is a directory") msg
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ethereum/main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go
index 8983b85a6..2e721dc71 100644
--- a/cmd/ethereum/main.go
+++ b/cmd/ethereum/main.go
@@ -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)
}