forked from cerc-io/plugeth
eth: use maxQueuedTxAnns for to limit the number of transactions announced (#21419)
This commit is contained in:
parent
d21303f9dd
commit
5d4512b113
@ -262,7 +262,7 @@ func (p *peer) announceTransactions(removePeer func(string)) {
|
|||||||
queue = append(queue, hashes...)
|
queue = append(queue, hashes...)
|
||||||
if len(queue) > maxQueuedTxAnns {
|
if len(queue) > maxQueuedTxAnns {
|
||||||
// Fancy copy and resize to ensure buffer doesn't grow indefinitely
|
// Fancy copy and resize to ensure buffer doesn't grow indefinitely
|
||||||
queue = queue[:copy(queue, queue[len(queue)-maxQueuedTxs:])]
|
queue = queue[:copy(queue, queue[len(queue)-maxQueuedTxAnns:])]
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-done:
|
case <-done:
|
||||||
|
Loading…
Reference in New Issue
Block a user