mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 11:41:19 +00:00
eth/protocols/eth: fix slice resize flaw (#22181)
This commit is contained in:
parent
ffc675a3c2
commit
a3d76f177b
@ -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…
Reference in New Issue
Block a user