From c76573a97b15e28c0d5c783cab3a62e9203db1c9 Mon Sep 17 00:00:00 2001 From: Dan DeGreef Date: Sat, 16 Jan 2021 11:15:18 -0600 Subject: [PATCH] eth/protocols/eth: fix slice resize flaw (#22181) --- eth/protocols/eth/broadcast.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/protocols/eth/broadcast.go b/eth/protocols/eth/broadcast.go index 2349398fae..74ec2f0654 100644 --- a/eth/protocols/eth/broadcast.go +++ b/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: