consensus: using make slice instead of bytes.Repeat

This commit is contained in:
cuiweixie 2026-01-17 21:25:43 +08:00
parent 127d1f42bb
commit 1c9f75d47c

View file

@ -545,7 +545,7 @@ func (c *Clique) Prepare(chain consensus.ChainHeaderReader, header *types.Header
// Ensure the extra data has all its components
if len(header.Extra) < extraVanity {
header.Extra = append(header.Extra, bytes.Repeat([]byte{0x00}, extraVanity-len(header.Extra))...)
header.Extra = append(header.Extra, make([]byte, extraVanity-len(header.Extra))...)
}
header.Extra = header.Extra[:extraVanity]