reverted back and made changes in the getAuthour API

This commit is contained in:
Pratik Patil 2022-06-28 19:02:47 +05:30
parent c0ad424824
commit de03f3fb6a
3 changed files with 5 additions and 19 deletions

View file

@ -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.

View file

@ -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.

View file

@ -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