mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
opt loop
This commit is contained in:
parent
2e06fbd409
commit
0e1812f6bf
1 changed files with 4 additions and 3 deletions
|
|
@ -66,15 +66,16 @@ type Manager struct {
|
||||||
func NewManager(config *Config, backends ...Backend) *Manager {
|
func NewManager(config *Config, backends ...Backend) *Manager {
|
||||||
// Retrieve the initial list of wallets from the backends and sort by URL
|
// Retrieve the initial list of wallets from the backends and sort by URL
|
||||||
var wallets []Wallet
|
var wallets []Wallet
|
||||||
for _, backend := range backends {
|
|
||||||
wallets = merge(wallets, backend.Wallets()...)
|
|
||||||
}
|
|
||||||
// Subscribe to wallet notifications from all backends
|
// Subscribe to wallet notifications from all backends
|
||||||
updates := make(chan WalletEvent, managerSubBufferSize)
|
updates := make(chan WalletEvent, managerSubBufferSize)
|
||||||
|
|
||||||
subs := make([]event.Subscription, len(backends))
|
subs := make([]event.Subscription, len(backends))
|
||||||
|
|
||||||
for i, backend := range backends {
|
for i, backend := range backends {
|
||||||
subs[i] = backend.Subscribe(updates)
|
subs[i] = backend.Subscribe(updates)
|
||||||
|
|
||||||
|
wallets = merge(wallets, backend.Wallets()...)
|
||||||
}
|
}
|
||||||
// Assemble the account manager and return
|
// Assemble the account manager and return
|
||||||
am := &Manager{
|
am := &Manager{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue