eth/filters: terminate pending tx subscription on error (#32794)

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 Alvarez
parent 9dcfdaff84
commit d5bc4abf95

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
}
}