From c0ad424824bda2cbc2659564e03a041714a230c6 Mon Sep 17 00:00:00 2001 From: Pratik Patil Date: Tue, 28 Jun 2022 18:34:29 +0530 Subject: [PATCH] addressed comments, Author() never returns error, returns 0x0 insted --- consensus/bor/bor.go | 10 +++++++++- consensus/clique/clique.go | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/consensus/bor/bor.go b/consensus/bor/bor.go index 37e5f87c13..05246390fe 100644 --- a/consensus/bor/bor.go +++ b/consensus/bor/bor.go @@ -292,7 +292,15 @@ func (c *Bor) Author(header *types.Header) (common.Address, error) { add := common.HexToAddress("0x0000000000000000000000000000000000000000") return add, nil } - return ecrecover(header, c.signatures, c.config) + + add, err := ecrecover(header, c.signatures, c.config) + + if err != nil { + add := common.HexToAddress("0x0000000000000000000000000000000000000000") + return add, nil + } else { + return add, nil + } } // VerifyHeader checks whether a header conforms to the consensus rules. diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index d63e0c37e3..ce9b636764 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -214,7 +214,15 @@ func (c *Clique) Author(header *types.Header) (common.Address, error) { add := common.HexToAddress("0x0000000000000000000000000000000000000000") return add, nil } - return ecrecover(header, c.signatures) + + add, err := ecrecover(header, c.signatures) + + if err != nil { + add := common.HexToAddress("0x0000000000000000000000000000000000000000") + return add, nil + } else { + return add, nil + } } // VerifyHeader checks whether a header conforms to the consensus rules.