mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
reverted back and made changes in the getAuthour API
This commit is contained in:
parent
c0ad424824
commit
de03f3fb6a
3 changed files with 5 additions and 19 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue