Skip to content

Commit

Permalink
Merge pull request ethereum#22765 from karalabe/revert-eth-hashrate
Browse files Browse the repository at this point in the history
eth: restore eth_hashrate API endpoint
  • Loading branch information
karalabe authored Apr 29, 2021
2 parents 64b60c7 + 06f44c0 commit 871f50b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions eth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ func (api *PublicEthereumAPI) Coinbase() (common.Address, error) {
return api.Etherbase()
}

// Hashrate returns the POW hashrate
func (api *PublicEthereumAPI) Hashrate() hexutil.Uint64 {
return hexutil.Uint64(api.e.Miner().Hashrate())
}

// PublicMinerAPI provides an API to control the miner.
// It offers only methods that operate on data that pose no security risk when it is publicly accessible.
type PublicMinerAPI struct {
Expand Down

0 comments on commit 871f50b

Please sign in to comment.