Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion eth/filters/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func (api *FilterAPI) NewPendingTransactionFilter(fullTx *bool) rpc.ID {
api.filtersMu.Unlock()

go func() {
defer pendingTxSub.Unsubscribe()
for {
select {
case pTx := <-pendingTxs:
Expand All @@ -155,7 +156,6 @@ func (api *FilterAPI) NewPendingTransactionFilter(fullTx *bool) rpc.ID {
api.filtersMu.Lock()
delete(api.filters, pendingTxSub.ID)
api.filtersMu.Unlock()
pendingTxSub.Unsubscribe()
return
}
}
Expand Down Expand Up @@ -218,6 +218,7 @@ func (api *FilterAPI) NewBlockFilter() rpc.ID {
api.filtersMu.Unlock()

go func() {
defer headerSub.Unsubscribe()
for {
select {
case h := <-headers:
Expand Down Expand Up @@ -403,6 +404,7 @@ func (api *FilterAPI) NewFilter(crit FilterCriteria) (rpc.ID, error) {
api.filtersMu.Unlock()

go func() {
defer logsSub.Unsubscribe()
for {
select {
case l := <-logs:
Expand Down