aboutsummaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-11-20 18:20:46 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-11-20 18:20:46 +0800
commit8a7983604446b3ad4a95c9d175e354339370b606 (patch)
treec456005e58dbe5eaee17e41c3de20aa0cc71c3cd /accounts
parentf5091e5711fc18205ed3a7c2d9d6a7fe7f0262f2 (diff)
downloaddexon-8a7983604446b3ad4a95c9d175e354339370b606.tar
dexon-8a7983604446b3ad4a95c9d175e354339370b606.tar.gz
dexon-8a7983604446b3ad4a95c9d175e354339370b606.tar.bz2
dexon-8a7983604446b3ad4a95c9d175e354339370b606.tar.lz
dexon-8a7983604446b3ad4a95c9d175e354339370b606.tar.xz
dexon-8a7983604446b3ad4a95c9d175e354339370b606.tar.zst
dexon-8a7983604446b3ad4a95c9d175e354339370b606.zip
accounts: list, then subscribe (sub requires active reader)
Diffstat (limited to 'accounts')
-rw-r--r--accounts/manager.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/accounts/manager.go b/accounts/manager.go
index 78ddb1368..96ca298fc 100644
--- a/accounts/manager.go
+++ b/accounts/manager.go
@@ -41,6 +41,11 @@ type Manager struct {
// NewManager creates a generic account manager to sign transaction via various
// supported backends.
func NewManager(backends ...Backend) *Manager {
+ // Retrieve the initial list of wallets from the backends and sort by URL
+ var wallets []Wallet
+ for _, backend := range backends {
+ wallets = merge(wallets, backend.Wallets()...)
+ }
// Subscribe to wallet notifications from all backends
updates := make(chan WalletEvent, 4*len(backends))
@@ -48,11 +53,6 @@ func NewManager(backends ...Backend) *Manager {
for i, backend := range backends {
subs[i] = backend.Subscribe(updates)
}
- // Retrieve the initial list of wallets from the backends and sort by URL
- var wallets []Wallet
- for _, backend := range backends {
- wallets = merge(wallets, backend.Wallets()...)
- }
// Assemble the account manager and return
am := &Manager{
backends: make(map[reflect.Type][]Backend),