From c357f136e75c923c2ccf0c79b165644c9cf76115 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Tue, 3 Feb 2026 12:44:45 +0100 Subject: [PATCH] eth/fetcher: remove useless checks Signed-off-by: Csaba Kiraly --- eth/fetcher/tx_fetcher.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index 13d189a95f..bc422e6abe 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -437,23 +437,12 @@ func (f *TxFetcher) loop() { oldHead *types.Header ) - //Subscribe to chain events to know when transactions are added to chain + // Subscribe to chain events to know when transactions are added to chain var headEventCh chan core.ChainEvent - var subErr <-chan error if f.chain != nil { headEventCh = make(chan core.ChainEvent, 10) sub := f.chain.SubscribeChainEvent(headEventCh) - subErr = sub.Err() - defer func() { - sub.Unsubscribe() - for { - select { - case <-headEventCh: // drain channel - default: - return - } - } - }() + defer sub.Unsubscribe() } for { @@ -895,9 +884,6 @@ func (f *TxFetcher) loop() { f.txOnChainCache.Add(tx.Hash(), struct{}{}) } - case <-subErr: - return - case <-f.quit: return }