diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-11-20 18:20:46 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-11-20 18:20:46 +0800 |
commit | 8a7983604446b3ad4a95c9d175e354339370b606 (patch) | |
tree | c456005e58dbe5eaee17e41c3de20aa0cc71c3cd /accounts | |
parent | f5091e5711fc18205ed3a7c2d9d6a7fe7f0262f2 (diff) | |
download | go-tangerine-8a7983604446b3ad4a95c9d175e354339370b606.tar go-tangerine-8a7983604446b3ad4a95c9d175e354339370b606.tar.gz go-tangerine-8a7983604446b3ad4a95c9d175e354339370b606.tar.bz2 go-tangerine-8a7983604446b3ad4a95c9d175e354339370b606.tar.lz go-tangerine-8a7983604446b3ad4a95c9d175e354339370b606.tar.xz go-tangerine-8a7983604446b3ad4a95c9d175e354339370b606.tar.zst go-tangerine-8a7983604446b3ad4a95c9d175e354339370b606.zip |
accounts: list, then subscribe (sub requires active reader)
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/manager.go | 10 |
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), |