mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-26 16:36:17 +00:00
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:
parent
a13de95b66
commit
6726b055f3
2 changed files with 5 additions and 3 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,5 +53,5 @@ func TestClose(t *testing.T) {
|
|||
defer backend.Close()
|
||||
sys := NewFilterSystem(backend, Config{})
|
||||
api := NewFilterAPI(sys, false)
|
||||
api.Close()
|
||||
CloseAPI(api)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue