eth/filters: terminate pending tx subscription on error (#32794)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

Fixes issue #32793. When the pending tx subscription ends, the filter
is removed from `api.filters`, but it is not terminated. There is no other 
way to terminate it, so the subscription will leak, and potentially block
the producer side.
This commit is contained in:
CertiK 2025-10-09 17:34:30 +08:00 committed by GitHub
parent 695c1445ab
commit a1b8e4880d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -152,6 +152,7 @@ func (api *FilterAPI) NewPendingTransactionFilter(fullTx *bool) rpc.ID {
api.filtersMu.Lock()
delete(api.filters, pendingTxSub.ID)
api.filtersMu.Unlock()
pendingTxSub.Unsubscribe()
return
}
}