accounts : fix quit channel goroutine leak

This commit is contained in:
ucwong 2020-04-03 08:54:32 +00:00
parent f7b29ec942
commit 5f9740c04e
2 changed files with 2 additions and 2 deletions

View file

@ -358,7 +358,7 @@ func (ks *KeyStore) TimedUnlock(a accounts.Account, passphrase string, timeout t
close(u.abort) close(u.abort)
} }
if timeout > 0 { if timeout > 0 {
u = &unlocked{Key: key, abort: make(chan struct{})} u = &unlocked{Key: key, abort: make(chan struct{}, 1)}
go ks.expire(a.Address, u, timeout) go ks.expire(a.Address, u, timeout)
} else { } else {
u = &unlocked{Key: key} u = &unlocked{Key: key}

View file

@ -37,7 +37,7 @@ func newWatcher(ac *accountCache) *watcher {
return &watcher{ return &watcher{
ac: ac, ac: ac,
ev: make(chan notify.EventInfo, 10), ev: make(chan notify.EventInfo, 10),
quit: make(chan struct{}), quit: make(chan struct{}, 1),
} }
} }