From 281e8cd5abaac86ed3f37f98250ff147b3c9fe62 Mon Sep 17 00:00:00 2001 From: Delweng Date: Thu, 8 Jun 2023 17:40:22 +0800 Subject: [PATCH] eth/filters: reuse handleLogs method for removed logs (#27438) --- eth/filters/filter_system.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 1768681c1..35e396c23 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -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 @@ -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: