Skip to content

Commit 6cd3c1c

Browse files
authored
Merge pull request #2387 from CortexFoundation/dev
fix data race when closing manager
2 parents 40960de + cada9d5 commit 6cd3c1c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

accounts/manager.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ func NewManager(config *Config, backends ...Backend) *Manager {
8383

8484
// Close terminates the account manager's internal notification processes.
8585
func (am *Manager) Close() error {
86-
for _, w := range am.wallets {
87-
w.Close()
88-
}
8986
errc := make(chan error)
9087
am.quit <- errc
9188
return <-errc
@@ -127,6 +124,10 @@ func (am *Manager) update() {
127124
am.feed.Send(event)
128125

129126
case errc := <-am.quit:
127+
// Close all owned wallets
128+
for _, w := range am.wallets {
129+
w.Close()
130+
}
130131
// Manager terminating, return
131132
errc <- nil
132133
return

0 commit comments

Comments
 (0)