From 49048a69f437b3eae6f1bd7b49c21377e36102f0 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Mon, 18 Dec 2023 10:50:09 +0800 Subject: [PATCH] Problem: unused cancel function in filter is not cleanup (#386) (#387) * Problem: f.cancel nil is not checked * Update CHANGELOG.md * cleanup --------- Signed-off-by: mmsqe --- CHANGELOG.md | 1 + rpc/namespaces/ethereum/eth/filters/api.go | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c555296482..0c90562fe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#364](https://github.com/crypto-org-chain/ethermint/pull/364) Only use NextBaseFee as last item to avoid concurrent write in `eth_feeHistory`. * (config) [#365](https://github.com/crypto-org-chain/ethermint/pull/365) Avoid redundant parse chainID from gensis when start server. * (rpc) [#382](https://github.com/crypto-org-chain/ethermint/pull/382) Align tracer config with go-ethereum. +* (rpc) [#386](https://github.com/crypto-org-chain/ethermint/pull/386) Cleanup unused cancel function in filter. ### Improvements diff --git a/rpc/namespaces/ethereum/eth/filters/api.go b/rpc/namespaces/ethereum/eth/filters/api.go index 571a18481d..794e304dd4 100644 --- a/rpc/namespaces/ethereum/eth/filters/api.go +++ b/rpc/namespaces/ethereum/eth/filters/api.go @@ -74,7 +74,6 @@ type filter struct { typ filters.Type deadline *time.Timer // filter is inactive when deadline triggers crit filters.FilterCriteria - cancel context.CancelFunc offset int // offset for stream subscription } @@ -118,7 +117,6 @@ func (api *PublicFilterAPI) timeoutLoop() { for id, f := range api.filters { select { case <-f.deadline.C: - f.cancel() delete(api.filters, id) default: continue