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
549f1add
Commit
549f1add
authored
Mar 30, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth: report unlock errors to RPC clients
parent
6f1ca0bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
api.go
eth/api.go
+3
-4
No files found.
eth/api.go
View file @
549f1add
...
@@ -440,17 +440,16 @@ func (s *PrivateAccountAPI) NewAccount(password string) (common.Address, error)
...
@@ -440,17 +440,16 @@ func (s *PrivateAccountAPI) NewAccount(password string) (common.Address, error)
// UnlockAccount will unlock the account associated with the given address with
// UnlockAccount will unlock the account associated with the given address with
// the given password for duration seconds. If duration is nil it will use a
// the given password for duration seconds. If duration is nil it will use a
// default of 300 seconds. It returns an indication if the account was unlocked.
// default of 300 seconds. It returns an indication if the account was unlocked.
func
(
s
*
PrivateAccountAPI
)
UnlockAccount
(
addr
common
.
Address
,
password
string
,
duration
*
rpc
.
HexNumber
)
bool
{
func
(
s
*
PrivateAccountAPI
)
UnlockAccount
(
addr
common
.
Address
,
password
string
,
duration
*
rpc
.
HexNumber
)
(
bool
,
error
)
{
if
duration
==
nil
{
if
duration
==
nil
{
duration
=
rpc
.
NewHexNumber
(
300
)
duration
=
rpc
.
NewHexNumber
(
300
)
}
}
a
:=
accounts
.
Account
{
Address
:
addr
}
a
:=
accounts
.
Account
{
Address
:
addr
}
d
:=
time
.
Duration
(
duration
.
Int64
())
*
time
.
Second
d
:=
time
.
Duration
(
duration
.
Int64
())
*
time
.
Second
if
err
:=
s
.
am
.
TimedUnlock
(
a
,
password
,
d
);
err
!=
nil
{
if
err
:=
s
.
am
.
TimedUnlock
(
a
,
password
,
d
);
err
!=
nil
{
glog
.
V
(
logger
.
Info
)
.
Infof
(
"%v
\n
"
,
err
)
return
false
,
err
return
false
}
}
return
true
return
true
,
nil
}
}
// LockAccount will lock the account associated with the given address when it's unlocked.
// LockAccount will lock the account associated with the given address when it's unlocked.
...
...
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