mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
accounts : fix quit channel goroutine leak
This commit is contained in:
parent
f7b29ec942
commit
5f9740c04e
2 changed files with 2 additions and 2 deletions
|
|
@ -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}
|
||||||
|
|
|
||||||
|
|
@ -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),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue