mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
consensus: use standard keccak API
This commit is contained in:
parent
835ef75baa
commit
e1211c8953
1 changed files with 3 additions and 6 deletions
|
|
@ -42,7 +42,6 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
"github.com/ethereum/go-ethereum/trie"
|
"github.com/ethereum/go-ethereum/trie"
|
||||||
"golang.org/x/crypto/sha3"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -641,11 +640,9 @@ func (c *Clique) Close() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SealHash returns the hash of a block prior to it being sealed.
|
// SealHash returns the hash of a block prior to it being sealed.
|
||||||
func SealHash(header *types.Header) (hash common.Hash) {
|
func SealHash(header *types.Header) common.Hash {
|
||||||
hasher := sha3.NewLegacyKeccak256()
|
encoded := CliqueRLP(header)
|
||||||
encodeSigHeader(hasher, header)
|
return crypto.Keccak256Hash(encoded)
|
||||||
hasher.(crypto.KeccakState).Read(hash[:])
|
|
||||||
return hash
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CliqueRLP returns the rlp bytes which needs to be signed for the proof-of-authority
|
// CliqueRLP returns the rlp bytes which needs to be signed for the proof-of-authority
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue