Skip to content

Commit 871f50b

Browse files
authored
Merge pull request #22765 from karalabe/revert-eth-hashrate
eth: restore eth_hashrate API endpoint
2 parents 64b60c7 + 06f44c0 commit 871f50b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎eth/api.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ func (api *PublicEthereumAPI) Coinbase() (common.Address, error) {
6161
return api.Etherbase()
6262
}
6363

64+
// Hashrate returns the POW hashrate
65+
func (api *PublicEthereumAPI) Hashrate() hexutil.Uint64 {
66+
return hexutil.Uint64(api.e.Miner().Hashrate())
67+
}
68+
6469
// PublicMinerAPI provides an API to control the miner.
6570
// It offers only methods that operate on data that pose no security risk when it is publicly accessible.
6671
type PublicMinerAPI struct {

0 commit comments

Comments
 (0)