Parcourir la source

eth: restore eth_hashrate API endpoint

Péter Szilágyi il y a 4 ans
Parent
commit
06f44c0fd4
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      eth/api.go

+ 5 - 0
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 {