core/types: update requests hash

This commit is contained in:
Felix Lange 2024-09-30 14:59:13 +02:00
parent ca1ed7689f
commit e9cf6255cb

View file

@ -18,6 +18,7 @@
package types
import (
"crypto/sha256"
"encoding/binary"
"fmt"
"io"
@ -475,10 +476,11 @@ func CalcUncleHash(uncles []*Header) common.Hash {
}
func CalcRequestsHash(requests [][]byte) common.Hash {
if len(requests) == 0 {
return EmptyRequestsHash
h := sha256.New()
for _, item := range requests {
h.Write(item)
}
return rlpHash(requests)
return common.Hash(h.Sum(nil))
}
// NewBlockWithHeader creates a block with the given header data. The