mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-28 08:37:22 +00:00
eth/fetcher: improve the condition to stall peer in tx fetcher (#32725)
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com> Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
32fea008d8
commit
b635e0632c
1 changed files with 2 additions and 2 deletions
|
|
@ -352,9 +352,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.Debug("Peer delivering stale transactions", "peer", peer, "rejected", otherreject)
|
||||
}
|
||||
}
|
||||
select {
|
||||
|
|
|
|||
Loading…
Reference in a new issue