modified Authour() function in bor.go

This commit is contained in:
Pratik Patil 2022-06-25 10:20:29 +05:30
parent 9b29d13a5d
commit 0173d61d9f
2 changed files with 5 additions and 0 deletions

View file

@ -288,6 +288,10 @@ func New(
// 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 *Bor) Author(header *types.Header) (common.Address, error) { func (c *Bor) Author(header *types.Header) (common.Address, error) {
if header.Number.Uint64() == 0 {
add := common.HexToAddress("0x0000000000000000000000000000000000000000")
return add, nil
}
return ecrecover(header, c.signatures, c.config) return ecrecover(header, c.signatures, c.config)
} }

View file

@ -817,6 +817,7 @@ func (s *PublicBlockChainAPI) GetHeaderByHash(ctx context.Context, hash common.H
// getAuthor: returns the author of the Block // getAuthor: returns the author of the Block
func (s *PublicBlockChainAPI) getAuthor(head *types.Header) (*common.Address, error) { func (s *PublicBlockChainAPI) getAuthor(head *types.Header) (*common.Address, error) {
// get author using Author() function from: /consensus/clique/clique.go // get author using Author() function from: /consensus/clique/clique.go
// In Production: get author using Author() function from: /consensus/bor/bor.go
author, err := s.b.Engine().Author(head) author, err := s.b.Engine().Author(head)
if err != nil { if err != nil {
return nil, err return nil, err