This commit is contained in:
parent
2337aa64eb
commit
d2d3166f35
6
accounts/external/backend.go
vendored
6
accounts/external/backend.go
vendored
@ -131,6 +131,12 @@ func (api *ExternalSigner) Accounts() []accounts.Account {
|
|||||||
func (api *ExternalSigner) Contains(account accounts.Account) bool {
|
func (api *ExternalSigner) Contains(account accounts.Account) bool {
|
||||||
api.cacheMu.RLock()
|
api.cacheMu.RLock()
|
||||||
defer api.cacheMu.RUnlock()
|
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 {
|
for _, a := range api.cache {
|
||||||
if a.Address == account.Address && (account.URL == (accounts.URL{}) || account.URL == api.URL()) {
|
if a.Address == account.Address && (account.URL == (accounts.URL{}) || account.URL == api.URL()) {
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user