aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/packages.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-02-20 01:58:15 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-02-20 01:58:15 +0800
commita59cd94625f589bb167be7a9c4588ff959dcfc00 (patch)
treefb7a4c697b6814da60f8cae29d0d497951e741f6 /rpc/packages.go
parent605dd3a9820bb74be883afe3cb0e462aca40b32d (diff)
downloadgo-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.gz
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.bz2
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.lz
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.xz
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.zst
go-tangerine-a59cd94625f589bb167be7a9c4588ff959dcfc00.zip
Add setMining RPC method
Diffstat (limited to 'rpc/packages.go')
-rw-r--r--rpc/packages.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/rpc/packages.go b/rpc/packages.go
index c969f58cc..d82538c92 100644
--- a/rpc/packages.go
+++ b/rpc/packages.go
@@ -267,6 +267,11 @@ func (p *EthereumApi) GetIsMining(reply *interface{}) error {
return nil
}
+func (p *EthereumApi) SetMining(shouldmine bool, reply *interface{}) error {
+ *reply = p.xeth.SetMining(shouldmine)
+ return nil
+}
+
func (p *EthereumApi) BlockNumber(reply *interface{}) error {
*reply = p.xeth.Backend().ChainManager().CurrentBlock().Number()
return nil
@@ -400,6 +405,12 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return p.GetIsListening(reply)
case "eth_mining":
return p.GetIsMining(reply)
+ case "eth_setMining":
+ args, err := req.ToBoolArgs()
+ if err != nil {
+ return err
+ }
+ return p.SetMining(args, reply)
case "eth_peerCount":
return p.GetPeerCount(reply)
case "eth_number":