mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
modified Authour() function in bor.go
This commit is contained in:
parent
9b29d13a5d
commit
0173d61d9f
2 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue