sharding: hashes collationHeaderData instead of the full header

Former-commit-id: 0cb0dcbd3241a34c34fd79cef2f8fec8e4ba0d5f [formerly 5e2f12a776dd956b1f98dc5a85b93a06ef22b581]
Former-commit-id: 7619acc6315efc4d71d0687b048d223a8cf4e3f7
This commit is contained in:
Raul Jordan 2018-05-16 12:59:00 -04:00
parent 8f731bfe28
commit e0ac2918cc

View File

@ -56,10 +56,10 @@ func NewCollationHeader(shardID *big.Int, chunkRoot *common.Hash, period *big.In
return &CollationHeader{data}
}
// Hash takes the keccak256 of the collation header's contents.
// Hash takes the keccak256 of the collation header's data contents.
func (h *CollationHeader) Hash() (hash common.Hash) {
hw := sha3.NewKeccak256()
rlp.Encode(hw, h)
rlp.Encode(hw, h.data)
hw.Sum(hash[:0])
return hash
}