accounts: add Find method

This commit is contained in:
Felix Lange 2016-09-22 02:23:50 +02:00
parent d27472cc74
commit 1aaa599147
1 changed files with 7 additions and 1 deletions

View File

@ -228,11 +228,17 @@ func (am *Manager) TimedUnlock(a Account, passphrase string, timeout time.Durati
return nil
}
func (am *Manager) getDecryptedKey(a Account, auth string) (Account, *Key, error) {
// Find resolves the given account into a unique entry in the keystore.
func (am *Manager) Find(a Account) (Account, error) {
am.cache.maybeReload()
am.cache.mu.Lock()
a, err := am.cache.find(a)
am.cache.mu.Unlock()
return a, err
}
func (am *Manager) getDecryptedKey(a Account, auth string) (Account, *Key, error) {
a, err := am.Find(a)
if err != nil {
return a, nil, err
}