aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/eth.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-08-06 17:58:14 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-08-06 18:58:54 +0800
commitc32073b11f12c3735c117b3b3c814505974d5a92 (patch)
treecfe83a65139ae8160dc7d1bbed8e22c56050bfd3 /rpc/api/eth.go
parent82ef26f6007986debd6ce082f57050f0c7e36006 (diff)
downloadgo-tangerine-c32073b11f12c3735c117b3b3c814505974d5a92.tar.gz
go-tangerine-c32073b11f12c3735c117b3b3c814505974d5a92.tar.zst
go-tangerine-c32073b11f12c3735c117b3b3c814505974d5a92.zip
miner, rpc: added submit hashrate for remote agents
Diffstat (limited to 'rpc/api/eth.go')
-rw-r--r--rpc/api/eth.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/rpc/api/eth.go b/rpc/api/eth.go
index 4041811f0..820ea761b 100644
--- a/rpc/api/eth.go
+++ b/rpc/api/eth.go
@@ -92,6 +92,7 @@ var (
"eth_hashrate": (*ethApi).Hashrate,
"eth_getWork": (*ethApi).GetWork,
"eth_submitWork": (*ethApi).SubmitWork,
+ "eth_submitHashrate": (*ethApi).SubmitHashrate,
"eth_resend": (*ethApi).Resend,
"eth_pendingTransactions": (*ethApi).PendingTransactions,
"eth_getTransactionReceipt": (*ethApi).GetTransactionReceipt,
@@ -573,6 +574,15 @@ func (self *ethApi) SubmitWork(req *shared.Request) (interface{}, error) {
return self.xeth.RemoteMining().SubmitWork(args.Nonce, common.HexToHash(args.Digest), common.HexToHash(args.Header)), nil
}
+func (self *ethApi) SubmitHashrate(req *shared.Request) (interface{}, error) {
+ args := new(SubmitHashRateArgs)
+ if err := self.codec.Decode(req.Params, &args); err != nil {
+ return nil, shared.NewDecodeParamError(err.Error())
+ }
+ self.xeth.RemoteMining().SubmitHashrate(common.HexToHash(args.Id), args.Rate)
+ return nil, nil
+}
+
func (self *ethApi) Resend(req *shared.Request) (interface{}, error) {
args := new(ResendArgs)
if err := self.codec.Decode(req.Params, &args); err != nil {