eth: use maxQueuedTxAnns for to limit the number of transactions announced (#21419)

pull/21424/head
timcooijmans 4 years ago committed by GitHub
parent d21303f9dd
commit 5d4512b113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      eth/peer.go

@ -262,7 +262,7 @@ func (p *peer) announceTransactions(removePeer func(string)) {
queue = append(queue, hashes...)
if len(queue) > maxQueuedTxAnns {
// 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:

Loading…
Cancel
Save