mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
Add GetCurrentProposer API call 🚧
This commit is contained in:
parent
b343bd10c6
commit
4037b09968
1 changed files with 10 additions and 0 deletions
|
|
@ -87,3 +87,13 @@ func (api *API) GetSignersAtHash(hash common.Hash) ([]common.Address, error) {
|
|||
}
|
||||
return snap.signers(), nil
|
||||
}
|
||||
|
||||
// GetSpan gets the current span details
|
||||
func (api *API) GetCurrentProposer() (common.Address, error) {
|
||||
header := api.chain.CurrentHeader()
|
||||
snap, err := api.bor.snapshot(api.chain, header.Number.Uint64(), header.Hash(), nil)
|
||||
if err != nil {
|
||||
return common.BytesToAddress(make([]byte, 20)), err
|
||||
}
|
||||
return snap.ValidatorSet.GetProposer().Address, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue