Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
aca9d6a1
Commit
aca9d6a1
authored
Mar 30, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/geth: print actual error when --unlock fails
parent
549f1add
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
accountcmd.go
cmd/geth/accountcmd.go
+2
-2
accountcmd_test.go
cmd/geth/accountcmd_test.go
+2
-2
No files found.
cmd/geth/accountcmd.go
View file @
aca9d6a1
...
...
@@ -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
{},
""
}
...
...
cmd/geth/accountcmd_test.go
View file @
aca9d6a1
...
...
@@ -168,7 +168,7 @@ Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 2/3
Passphrase: {{.InputLine "wrong2"}}
Unlocking account f466859ead1932d743d622cb74fc058882e8648a | Attempt 3/3
Passphrase: {{.InputLine "wrong3"}}
Fatal: Failed to unlock account
: f466859ead1932d743d622cb74fc058882e8648a
Fatal: Failed to unlock account
f466859ead1932d743d622cb74fc058882e8648a (could not decrypt key with given passphrase)
`
)
}
...
...
@@ -225,6 +225,6 @@ func TestUnlockFlagPasswordFileWrongPassword(t *testing.T) {
"--password"
,
"testdata/wrong-passwords.txt"
,
"--unlock"
,
"0,2"
)
defer
geth
.
expectExit
()
geth
.
expect
(
`
Fatal: Failed to unlock account
: 0
Fatal: Failed to unlock account
0 (could not decrypt key with given passphrase)
`
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment