fix: do not expose eth_close from the FilterAPI (#256)

## Why this should be merged

Currently, `eth_close` is being registered as an available RPC due to
`Close` being an exported function on the `FilterAPI`.

## How this works

Converts the method to a function that takes in the API.

## How this was tested

Updated unit test.
This commit is contained in:
Stephen Buttolph 2026-01-05 12:32:37 -05:00 committed by GitHub
parent a13de95b66
commit 6726b055f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -16,7 +16,9 @@
package filters
// Close releases resources held by the API.
func (api *FilterAPI) Close() {
// CloseAPI releases resources held by the API.
//
// This is not implemented as a method to avoid exposing it via RPC.
func CloseAPI(api *FilterAPI) {
close(api.quit)
}

View file

@ -53,5 +53,5 @@ func TestClose(t *testing.T) {
defer backend.Close()
sys := NewFilterSystem(backend, Config{})
api := NewFilterAPI(sys, false)
api.Close()
CloseAPI(api)
}