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 package types
import ( import (
"crypto/sha256"
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"io" "io"
@ -475,10 +476,11 @@ func CalcUncleHash(uncles []*Header) common.Hash {
} }
func CalcRequestsHash(requests [][]byte) common.Hash { func CalcRequestsHash(requests [][]byte) common.Hash {
if len(requests) == 0 { h := sha256.New()
return EmptyRequestsHash 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 // NewBlockWithHeader creates a block with the given header data. The