From 0173d61d9fca9aba4a41fa3321cedb5c361b0ab9 Mon Sep 17 00:00:00 2001 From: Pratik Patil Date: Sat, 25 Jun 2022 10:20:29 +0530 Subject: [PATCH] modified Authour() function in bor.go --- consensus/bor/bor.go | 4 ++++ internal/ethapi/api.go | 1 + 2 files changed, 5 insertions(+) diff --git a/consensus/bor/bor.go b/consensus/bor/bor.go index 2eb2645f18..37e5f87c13 100644 --- a/consensus/bor/bor.go +++ b/consensus/bor/bor.go @@ -288,6 +288,10 @@ func New( // Author implements consensus.Engine, returning the Ethereum address recovered // from the signature in the header's extra-data section. 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) } diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index f8924e873b..5a5de6bc9d 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -817,6 +817,7 @@ func (s *PublicBlockChainAPI) GetHeaderByHash(ctx context.Context, hash common.H // getAuthor: returns the author of the Block func (s *PublicBlockChainAPI) getAuthor(head *types.Header) (*common.Address, error) { // 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) if err != nil { return nil, err