aboutsummaryrefslogtreecommitdiff
path: root/accounts/manager.go
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-09-15 23:55:34 -0400
committerDeterminant <[email protected]>2020-09-15 23:55:34 -0400
commit78745551c077bf54151202138c2629f288769561 (patch)
tree2b628e99fd110617089778fa91235ecd2888f4ef /accounts/manager.go
parent7d1388c743b4ec8f4a86bea95bfada785dee83f7 (diff)
WIP: geth-tavum
Diffstat (limited to 'accounts/manager.go')
-rw-r--r--accounts/manager.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/accounts/manager.go b/accounts/manager.go
index 39211da..87d3df8 100644
--- a/accounts/manager.go
+++ b/accounts/manager.go
@@ -141,6 +141,11 @@ func (am *Manager) Wallets() []Wallet {
am.lock.RLock()
defer am.lock.RUnlock()
+ return am.walletsNoLock()
+}
+
+// walletsNoLock returns all registered wallets. Callers must hold am.lock.
+func (am *Manager) walletsNoLock() []Wallet {
cpy := make([]Wallet, len(am.wallets))
copy(cpy, am.wallets)
return cpy
@@ -155,7 +160,7 @@ func (am *Manager) Wallet(url string) (Wallet, error) {
if err != nil {
return nil, err
}
- for _, wallet := range am.Wallets() {
+ for _, wallet := range am.walletsNoLock() {
if wallet.URL() == parsed {
return wallet, nil
}