consensus/clique: avoid a copy in clique (#23149)
* consensus/clique:optimize to avoid a copy in clique * consensus/clique: test for sealhash Co-authored-by: Martin Holst Swende <martin@swende.se>
This commit is contained in:
@ -710,7 +710,7 @@ func (c *Clique) APIs(chain consensus.ChainHeaderReader) []rpc.API {
|
||||
func SealHash(header *types.Header) (hash common.Hash) {
|
||||
hasher := sha3.NewLegacyKeccak256()
|
||||
encodeSigHeader(hasher, header)
|
||||
hasher.Sum(hash[:0])
|
||||
hasher.(crypto.KeccakState).Read(hash[:])
|
||||
return hash
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user