From 9e2e8f041dae4054e7682966a805e205133db216 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:39:49 +0200 Subject: [PATCH] don't copy header fields in WithBody --- core/types/block.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/types/block.go b/core/types/block.go index c1ae8f732d..bcc7ab608e 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -483,13 +483,13 @@ func (b *Block) WithWitness(witness *ExecutionWitness) *Block { block := &Block{ header: b.header, - transactions: slices.Clone(b.transactions), + transactions: b.transactions, uncles: make([]*Header, len(b.uncles)), - withdrawals: slices.Clone(b.withdrawals), + withdrawals: b.withdrawals, witness: witness, } for i := range b.uncles { - block.uncles[i] = CopyHeader(b.uncles[i]) + block.uncles[i] = b.uncles[i] } return block }