mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/bloombits/matcher : Call stop timer if return before timeout
This commit is contained in:
parent
f7b29ec942
commit
3ec95e7751
1 changed files with 2 additions and 1 deletions
|
|
@ -529,7 +529,8 @@ func (s *MatcherSession) Close() {
|
||||||
s.closer.Do(func() {
|
s.closer.Do(func() {
|
||||||
// Signal termination and wait for all goroutines to tear down
|
// Signal termination and wait for all goroutines to tear down
|
||||||
close(s.quit)
|
close(s.quit)
|
||||||
time.AfterFunc(time.Second, func() { close(s.kill) })
|
timeout := time.AfterFunc(time.Second, func() { close(s.kill) })
|
||||||
|
defer timeout.Stop()
|
||||||
s.pend.Wait()
|
s.pend.Wait()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue