getAuthor returns 0x0 for genesis block

This commit is contained in:
Pratik Patil 2022-06-24 13:29:02 +05:30
parent 1970743f9d
commit 1b941f3274

View file

@ -210,6 +210,10 @@ func New(config *params.CliqueConfig, db ethdb.Database) *Clique {
// Author implements consensus.Engine, returning the Ethereum address recovered // Author implements consensus.Engine, returning the Ethereum address recovered
// from the signature in the header's extra-data section. // from the signature in the header's extra-data section.
func (c *Clique) Author(header *types.Header) (common.Address, error) { func (c *Clique) Author(header *types.Header) (common.Address, error) {
if header.Number.Uint64() == 0 {
add := common.HexToAddress("0x0000000000000000000000000000000000000000")
return add, nil
}
return ecrecover(header, c.signatures) return ecrecover(header, c.signatures)
} }