Skip to content

Commit 8a79836

Browse files
committed
accounts: list, then subscribe (sub requires active reader)
1 parent f5091e5 commit 8a79836

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

accounts/manager.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ type Manager struct {
4141
// NewManager creates a generic account manager to sign transaction via various
4242
// supported backends.
4343
func NewManager(backends ...Backend) *Manager {
44+
// Retrieve the initial list of wallets from the backends and sort by URL
45+
var wallets []Wallet
46+
for _, backend := range backends {
47+
wallets = merge(wallets, backend.Wallets()...)
48+
}
4449
// Subscribe to wallet notifications from all backends
4550
updates := make(chan WalletEvent, 4*len(backends))
4651

4752
subs := make([]event.Subscription, len(backends))
4853
for i, backend := range backends {
4954
subs[i] = backend.Subscribe(updates)
5055
}
51-
// Retrieve the initial list of wallets from the backends and sort by URL
52-
var wallets []Wallet
53-
for _, backend := range backends {
54-
wallets = merge(wallets, backend.Wallets()...)
55-
}
5656
// Assemble the account manager and return
5757
am := &Manager{
5858
backends: make(map[reflect.Type][]Backend),

0 commit comments

Comments
 (0)