eth/filters: ensure API timeoutLoop terminates with event system (#31056)
Discovered from failing test introduced https://github.com/ethereum/go-ethereum/pull/31033 . We should ensure `timeoutLoop` terminates if the filter event system is terminated.
This commit is contained in:
parent
2bf4a8ff73
commit
6c10996bf5
|
@ -90,7 +90,11 @@ func (api *FilterAPI) timeoutLoop(timeout time.Duration) {
|
|||
ticker := time.NewTicker(timeout)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
<-ticker.C
|
||||
select {
|
||||
case <-ticker.C:
|
||||
case <-api.events.chainSub.Err():
|
||||
return
|
||||
}
|
||||
api.filtersMu.Lock()
|
||||
for id, f := range api.filters {
|
||||
select {
|
||||
|
|
Loading…
Reference in New Issue