aboutsummaryrefslogtreecommitdiffstats
path: root/eth/api.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-03-31 03:02:54 +0800
committerFelix Lange <fjl@twurst.com>2016-04-12 21:59:12 +0800
commit549f1add296ccfb76d5038316acb4d7c3935221a (patch)
treeb6f09eec9f0dceab9c85e4a1cf93c6c88f167877 /eth/api.go
parent6f1ca0bc910b65b517277f72ca52dadcdc713570 (diff)
downloadgo-tangerine-549f1add296ccfb76d5038316acb4d7c3935221a.tar
go-tangerine-549f1add296ccfb76d5038316acb4d7c3935221a.tar.gz
go-tangerine-549f1add296ccfb76d5038316acb4d7c3935221a.tar.bz2
go-tangerine-549f1add296ccfb76d5038316acb4d7c3935221a.tar.lz
go-tangerine-549f1add296ccfb76d5038316acb4d7c3935221a.tar.xz
go-tangerine-549f1add296ccfb76d5038316acb4d7c3935221a.tar.zst
go-tangerine-549f1add296ccfb76d5038316acb4d7c3935221a.zip
eth: report unlock errors to RPC clients
Diffstat (limited to 'eth/api.go')
-rw-r--r--eth/api.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/eth/api.go b/eth/api.go
index 20cf6de39..b82a1addd 100644
--- a/eth/api.go
+++ b/eth/api.go
@@ -440,17 +440,16 @@ func (s *PrivateAccountAPI) NewAccount(password string) (common.Address, error)
// 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
// 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 {
duration = rpc.NewHexNumber(300)
}
a := accounts.Account{Address: addr}
d := time.Duration(duration.Int64()) * time.Second
if err := s.am.TimedUnlock(a, password, d); err != nil {
- glog.V(logger.Info).Infof("%v\n", err)
- return false
+ return false, err
}
- return true
+ return true, nil
}
// LockAccount will lock the account associated with the given address when it's unlocked.