This commit is contained in:
zc-p 2024-04-21 09:47:35 +08:00
parent 2e06fbd409
commit 0e1812f6bf

View file

@ -66,15 +66,16 @@ type Manager struct {
func NewManager(config *Config, 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, managerSubBufferSize)
subs := make([]event.Subscription, len(backends))
for i, backend := range backends {
subs[i] = backend.Subscribe(updates)
wallets = merge(wallets, backend.Wallets()...)
}
// Assemble the account manager and return
am := &Manager{