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

This commit is contained in:
timcooijmans 2020-08-06 14:19:00 +02:00 committed by GitHub
parent d21303f9dd
commit 5d4512b113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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: