From 97edaa40b59ac1b08180423571c3526c1b233840 Mon Sep 17 00:00:00 2001 From: ucwong Date: Thu, 1 Jan 2026 07:14:47 +0800 Subject: [PATCH] improve the condition to stall peer in tx fetcher --- ctxc/fetcher/tx_fetcher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctxc/fetcher/tx_fetcher.go b/ctxc/fetcher/tx_fetcher.go index 73d51bd4c5..2b7c2d0193 100644 --- a/ctxc/fetcher/tx_fetcher.go +++ b/ctxc/fetcher/tx_fetcher.go @@ -322,9 +322,9 @@ func (f *TxFetcher) Enqueue(peer string, txs []*types.Transaction, direct bool) otherRejectMeter.Mark(otherreject) // If 'other reject' is >25% of the deliveries in any batch, sleep a bit. - if otherreject > addTxsBatchSize/4 { + if otherreject > int64((len(batch)+3)/4) { + log.Debug("Peer delivering stale or invalid transactions", "peer", peer, "rejected", otherreject) time.Sleep(200 * time.Millisecond) - log.Trace("Peer delivering stale transactions", "peer", peer, "rejected", otherreject) } } select {