From 06f44c0fd425a0a3d82c7f3470da0314d6dc369e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 29 Apr 2021 12:02:30 +0300 Subject: [PATCH] eth: restore eth_hashrate API endpoint --- eth/api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eth/api.go b/eth/api.go index e02c0ca4d..7387459c9 100644 --- a/eth/api.go +++ b/eth/api.go @@ -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 {