good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit d2d3166f authored by Martin Holst Swende's avatar Martin Holst Swende Committed by GitHub
Browse files

accounts/external: fill account-cache if that hasn't already been done, fixes #20995 (#20998)

parent 2337aa64
Branches
Tags
No related merge requests found
......@@ -131,6 +131,12 @@ func (api *ExternalSigner) Accounts() []accounts.Account {
func (api *ExternalSigner) Contains(account accounts.Account) bool {
api.cacheMu.RLock()
defer api.cacheMu.RUnlock()
if api.cache == nil {
// If we haven't already fetched the accounts, it's time to do so now
api.cacheMu.RUnlock()
api.Accounts()
api.cacheMu.RLock()
}
for _, a := range api.cache {
if a.Address == account.Address && (account.URL == (accounts.URL{}) || account.URL == api.URL()) {
return true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment