diff --git a/consensus/bor/bor.go b/consensus/bor/bor.go index 05246390fe..37e5f87c13 100644 --- a/consensus/bor/bor.go +++ b/consensus/bor/bor.go @@ -292,15 +292,7 @@ func (c *Bor) Author(header *types.Header) (common.Address, error) { add := common.HexToAddress("0x0000000000000000000000000000000000000000") return add, nil } - - add, err := ecrecover(header, c.signatures, c.config) - - if err != nil { - add := common.HexToAddress("0x0000000000000000000000000000000000000000") - return add, nil - } else { - return add, nil - } + return ecrecover(header, c.signatures, c.config) } // VerifyHeader checks whether a header conforms to the consensus rules. diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index ce9b636764..d63e0c37e3 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -214,15 +214,7 @@ func (c *Clique) Author(header *types.Header) (common.Address, error) { add := common.HexToAddress("0x0000000000000000000000000000000000000000") return add, nil } - - add, err := ecrecover(header, c.signatures) - - if err != nil { - add := common.HexToAddress("0x0000000000000000000000000000000000000000") - return add, nil - } else { - return add, nil - } + return ecrecover(header, c.signatures) } // VerifyHeader checks whether a header conforms to the consensus rules. diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 5a5de6bc9d..9f57da33b9 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -819,8 +819,10 @@ func (s *PublicBlockChainAPI) getAuthor(head *types.Header) (*common.Address, er // 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) + // make sure we don't send error to the user, return 0x0 instead if err != nil { - return nil, err + add := common.HexToAddress("0x0000000000000000000000000000000000000000") + return &add, nil } // change the coinbase (0x0) with the miner address return &author, nil