eth/fetcher: improve the condition to stall peer in tx fetcher

This commit is contained in:
Gary Rong 2025-09-24 10:34:20 +08:00
parent 479b8031dc
commit a02f418945

View file

@ -375,9 +375,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)/4) {
time.Sleep(200 * time.Millisecond)
log.Debug("Peer delivering stale transactions", "peer", peer, "rejected", otherreject)
log.Debug("Peer delivering invalid transactions", "peer", peer, "rejected", otherreject)
}
}
select {