make sure single tx batches are not over-penalized

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2025-12-29 15:18:50 +01:00
parent de60ff5036
commit f8d5d10c0c
No known key found for this signature in database
GPG key ID: 0FE274EE8C95166E

View file

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