eth/protocols/eth: fix slice resize flaw (#22181)

pull/22189/head
Dan DeGreef 4 years ago committed by GitHub
parent 8d62ee65b2
commit c76573a97b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      eth/protocols/eth/broadcast.go

@ -179,7 +179,7 @@ func (p *Peer) announceTransactions() {
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