aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rpc/api.go2
-rw-r--r--xeth/xeth.go4
2 files changed, 6 insertions, 0 deletions
diff --git a/rpc/api.go b/rpc/api.go
index 4a9eb5963..6d3a20bfa 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -467,6 +467,8 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
return err
}
*reply = api.xeth().WhisperMessages(args.Id)
+ case "eth_hashrate":
+ *reply = newHexNum(api.xeth().HashRate())
// case "eth_register":
// // Placeholder for actual type
diff --git a/xeth/xeth.go b/xeth/xeth.go
index e4040d9d8..692fb338c 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -280,6 +280,10 @@ func (self *XEth) IsMining() bool {
return self.backend.IsMining()
}
+func (self *XEth) HashRate() int64 {
+ return self.backend.Miner().HashRate()
+}
+
func (self *XEth) EthVersion() string {
return fmt.Sprintf("%d", self.backend.EthVersion())
}