diff --git a/eth/filters/api.go b/eth/filters/api.go index e3057a2af2..607dac006d 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -435,7 +435,10 @@ func (api *FilterAPI) GetFilterChanges(id rpc.ID) (interface{}, error) { if !f.deadline.Stop() { // timer expired but filter is not yet removed in timeout loop // receive timer value and reset timer - <-f.deadline.C + select { + case <-f.deadline.C: + default: + } } f.deadline.Reset(api.timeout) diff --git a/rpc/websocket.go b/rpc/websocket.go index 9f67caf859..bd7dcdee0b 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -357,7 +357,10 @@ func (wc *websocketCodec) pingLoop() { case <-wc.pingReset: if !pingTimer.Stop() { - <-pingTimer.C + select { + case <-pingTimer.C: + default: + } } pingTimer.Reset(wsPingInterval)