Skip to content

Commit 653baed

Browse files
committed
eth/fetcher: fix panic + add warn log
1 parent de87588 commit 653baed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

eth/fetcher/tx_fetcher.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ func (f *TxFetcher) Enqueue(peer string, txs []*types.Transaction, direct bool)
303303
for f.underpriced.Cardinality() >= maxTxUnderpricedSetSize {
304304
f.underpriced.Pop()
305305
}
306-
f.underpriced.Add(batch[i].Hash())
306+
f.underpriced.Add(batch[j].Hash())
307307
}
308308
// Track a few interesting failure types
309309
switch {
@@ -328,6 +328,7 @@ func (f *TxFetcher) Enqueue(peer string, txs []*types.Transaction, direct bool)
328328
// out of sync with the chain or the peer is griefing us.
329329
if otherreject > 128/4 {
330330
delay = 200 * time.Millisecond
331+
log.Warn("Peer delivering useless transactions, sleeping", "ignored", len(txs)-i)
331332
break
332333
}
333334
}

0 commit comments

Comments
 (0)