This commit is contained in:
kane 2018-07-30 06:26:51 -04:00
parent 3475a4b225
commit ef42a3dffd

View file

@ -137,6 +137,12 @@ func rlpHash(x interface{}) (h common.Hash) {
return h return h
} }
func hash(x interface{}) (h common.Hash) {
hw := sha3.NewKeccak256()
hw.Sum(h[:0])
return h
}
// Body is a simple (mutable, non-safe) data container for storing and moving // Body is a simple (mutable, non-safe) data container for storing and moving
// a block's data contents (transactions and uncles) together. // a block's data contents (transactions and uncles) together.
type Body struct { type Body struct {
@ -351,7 +357,7 @@ func (c *writeCounter) Write(b []byte) (int, error) {
} }
func CalcUncleHash(uncles []*Header) common.Hash { func CalcUncleHash(uncles []*Header) common.Hash {
return rlpHash(uncles) return hash(uncles)
} }
// WithSeal returns a new block with the data from b but the header replaced with // WithSeal returns a new block with the data from b but the header replaced with