Skip to content

Commit

Permalink
eth/protocols/eth: fix slice resize flaw (ethereum#22181)
Browse files Browse the repository at this point in the history
  • Loading branch information
dadeg authored Jan 16, 2021
1 parent 8d62ee6 commit c76573a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eth/protocols/eth/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c76573a

Please sign in to comment.