added eth_hashrate

This commit is contained in:
Bas van Kervel 2015-06-03 09:22:45 +02:00
parent 8812b3e4c3
commit 969adf0c06

View file

@ -57,6 +57,7 @@ var (
"eth_getFilterChanges": (*eth).GetFilterChanges,
"eth_getFilterLogs": (*eth).GetFilterLogs,
"eth_getLogs": (*eth).GetLogs,
"eth_hashrate": (*eth).Hashrate,
"eth_getWork": (*eth).GetWork,
"eth_submitWork": (*eth).SubmitWork,
}
@ -110,6 +111,10 @@ func (self *eth) Accounts(req *shared.Request) (interface{}, error) {
return self.xeth.Accounts(), nil
}
func (self *eth) Hashrate(req *shared.Request) (interface{}, error) {
return newHexNum(self.xeth.HashRate()), nil
}
func (self *eth) BlockNumber(req *shared.Request) (interface{}, error) {
return self.xeth.CurrentBlock().Number(), nil
}