Explorar el Código

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

Dan DeGreef hace 4 años
padre
commit
c76573a97b
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      eth/protocols/eth/broadcast.go

+ 1 - 1
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: