Skip to content

Commit

Permalink
eth/filters: reuse handleLogs method for removed logs (#27438)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvisa committed Jun 8, 2023
1 parent 5c51ef8 commit 281e8cd
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions eth/filters/filter_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,6 @@ 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 @@ -573,7 +564,7 @@ func (es *EventSystem) eventLoop() {
case ev := <-es.logsCh:
es.handleLogs(index, ev)
case ev := <-es.rmLogsCh:
es.handleRemovedLogs(index, ev)
es.handleLogs(index, ev.Logs)
case ev := <-es.pendingLogsCh:
es.handlePendingLogs(index, ev)
case ev := <-es.chainCh:
Expand Down

0 comments on commit 281e8cd

Please sign in to comment.