Skip to content

Commit

Permalink
Revert "eth/filters: reuse handleLogs method for removed logs (ethere…
Browse files Browse the repository at this point in the history
…um#27438)"

This reverts commit dc18557.
  • Loading branch information
devopsbo3 committed Nov 10, 2023
1 parent 47cf2fe commit 73608c0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion eth/filters/filter_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,15 @@ func (es *EventSystem) handlePendingLogs(filters filterIndex, ev []*types.Log) {
}
}

func (es *EventSystem) handleRemovedLogs(filters filterIndex, ev core.RemovedLogsEvent) {
for _, f := range filters[LogsSubscription] {
matchedLogs := filterLogs(ev.Logs, f.logsCrit.FromBlock, f.logsCrit.ToBlock, f.logsCrit.Addresses, f.logsCrit.Topics)
if len(matchedLogs) > 0 {
f.logs <- matchedLogs
}
}
}

func (es *EventSystem) handleTxsEvent(filters filterIndex, ev core.NewTxsEvent) {
for _, f := range filters[PendingTransactionsSubscription] {
f.txs <- ev.Txs
Expand Down Expand Up @@ -564,7 +573,7 @@ func (es *EventSystem) eventLoop() {
case ev := <-es.logsCh:
es.handleLogs(index, ev)
case ev := <-es.rmLogsCh:
es.handleLogs(index, ev.Logs)
es.handleRemovedLogs(index, ev)
case ev := <-es.pendingLogsCh:
es.handlePendingLogs(index, ev)
case ev := <-es.chainCh:
Expand Down

0 comments on commit 73608c0

Please sign in to comment.