diff --git a/core/bloombits/matcher.go b/core/bloombits/matcher.go index 3ec0d5ae94..a82c9c9203 100644 --- a/core/bloombits/matcher.go +++ b/core/bloombits/matcher.go @@ -529,7 +529,8 @@ func (s *MatcherSession) Close() { s.closer.Do(func() { // Signal termination and wait for all goroutines to tear down 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() }) }