diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-08-09 17:51:16 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-08-09 18:26:07 +0800 |
commit | 5d9ac49c7e6027c60998a56287dbb3e407011c9b (patch) | |
tree | 325712b0955076ba81a91031e84f25dee88727b2 /accounts/keystore | |
parent | db568a61e2a98880ab308bf2224aa34073dc7f39 (diff) | |
download | go-tangerine-5d9ac49c7e6027c60998a56287dbb3e407011c9b.tar go-tangerine-5d9ac49c7e6027c60998a56287dbb3e407011c9b.tar.gz go-tangerine-5d9ac49c7e6027c60998a56287dbb3e407011c9b.tar.bz2 go-tangerine-5d9ac49c7e6027c60998a56287dbb3e407011c9b.tar.lz go-tangerine-5d9ac49c7e6027c60998a56287dbb3e407011c9b.tar.xz go-tangerine-5d9ac49c7e6027c60998a56287dbb3e407011c9b.tar.zst go-tangerine-5d9ac49c7e6027c60998a56287dbb3e407011c9b.zip |
accounts: refactor API for generalized USB wallets
Diffstat (limited to 'accounts/keystore')
-rw-r--r-- | accounts/keystore/keystore_wallet.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/accounts/keystore/keystore_wallet.go b/accounts/keystore/keystore_wallet.go index 7165d2821..758fdfe36 100644 --- a/accounts/keystore/keystore_wallet.go +++ b/accounts/keystore/keystore_wallet.go @@ -36,16 +36,16 @@ func (w *keystoreWallet) URL() accounts.URL { return w.account.URL } -// Status implements accounts.Wallet, always returning "open", since there is no -// concept of open/close for plain keystore accounts. -func (w *keystoreWallet) Status() string { +// Status implements accounts.Wallet, returning whether the account held by the +// keystore wallet is unlocked or not. +func (w *keystoreWallet) Status() (string, error) { w.keystore.mu.RLock() defer w.keystore.mu.RUnlock() if _, ok := w.keystore.unlocked[w.account.Address]; ok { - return "Unlocked" + return "Unlocked", nil } - return "Locked" + return "Locked", nil } // Open implements accounts.Wallet, but is a noop for plain wallets since there |