mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
core/types: fix witness
This commit is contained in:
parent
9e2e8f041d
commit
5bfe055e1c
1 changed files with 7 additions and 7 deletions
|
|
@ -205,6 +205,9 @@ type Block struct {
|
||||||
transactions Transactions
|
transactions Transactions
|
||||||
withdrawals Withdrawals
|
withdrawals Withdrawals
|
||||||
|
|
||||||
|
// witness is not an encoded part of the block body.
|
||||||
|
// It is held in Block in order for easy relaying to the places
|
||||||
|
// that process it.
|
||||||
witness *ExecutionWitness
|
witness *ExecutionWitness
|
||||||
|
|
||||||
// caches
|
// caches
|
||||||
|
|
@ -461,6 +464,7 @@ func (b *Block) WithSeal(header *Header) *Block {
|
||||||
transactions: b.transactions,
|
transactions: b.transactions,
|
||||||
uncles: b.uncles,
|
uncles: b.uncles,
|
||||||
withdrawals: b.withdrawals,
|
withdrawals: b.withdrawals,
|
||||||
|
witness: b.witness,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -472,6 +476,7 @@ func (b *Block) WithBody(body Body) *Block {
|
||||||
transactions: slices.Clone(body.Transactions),
|
transactions: slices.Clone(body.Transactions),
|
||||||
uncles: make([]*Header, len(body.Uncles)),
|
uncles: make([]*Header, len(body.Uncles)),
|
||||||
withdrawals: slices.Clone(body.Withdrawals),
|
withdrawals: slices.Clone(body.Withdrawals),
|
||||||
|
witness: b.witness,
|
||||||
}
|
}
|
||||||
for i := range body.Uncles {
|
for i := range body.Uncles {
|
||||||
block.uncles[i] = CopyHeader(body.Uncles[i])
|
block.uncles[i] = CopyHeader(body.Uncles[i])
|
||||||
|
|
@ -480,18 +485,13 @@ func (b *Block) WithBody(body Body) *Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Block) WithWitness(witness *ExecutionWitness) *Block {
|
func (b *Block) WithWitness(witness *ExecutionWitness) *Block {
|
||||||
|
return &Block{
|
||||||
block := &Block{
|
|
||||||
header: b.header,
|
header: b.header,
|
||||||
transactions: b.transactions,
|
transactions: b.transactions,
|
||||||
uncles: make([]*Header, len(b.uncles)),
|
uncles: b.uncles,
|
||||||
withdrawals: b.withdrawals,
|
withdrawals: b.withdrawals,
|
||||||
witness: witness,
|
witness: witness,
|
||||||
}
|
}
|
||||||
for i := range b.uncles {
|
|
||||||
block.uncles[i] = b.uncles[i]
|
|
||||||
}
|
|
||||||
return block
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hash returns the keccak256 hash of b's header.
|
// Hash returns the keccak256 hash of b's header.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue