瀏覽代碼

output error message if unlock address is invalid (fixes the wierd "read /path: is a directory") msg

zelig 10 年之前
父節點
當前提交
abbdf41560
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      cmd/ethereum/main.go

+ 5 - 1
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)
 		}