Skip to content

Commit

Permalink
Problem: unused cancel function in filter is not cleanup (#386) (#387)
Browse files Browse the repository at this point in the history
* Problem: f.cancel nil is not checked

* Update CHANGELOG.md



* cleanup

---------

Signed-off-by: mmsqe <mavis@crypto.com>
  • Loading branch information
mmsqe authored Dec 18, 2023
1 parent aaff96b commit 49048a6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions rpc/namespaces/ethereum/eth/filters/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 49048a6

Please sign in to comment.