aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.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 /xeth/xeth.go
parent605dd3a9820bb74be883afe3cb0e462aca40b32d (diff)
downloaddexon-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar
dexon-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.gz
dexon-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.bz2
dexon-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.lz
dexon-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.xz
dexon-a59cd94625f589bb167be7a9c4588ff959dcfc00.tar.zst
dexon-a59cd94625f589bb167be7a9c4588ff959dcfc00.zip
Add setMining RPC method
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r--xeth/xeth.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index f005105bb..06915c5e0 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -102,6 +102,17 @@ func (self *XEth) IsMining() bool {
return self.miner.Mining()
}
+func (self *XEth) SetMining(shouldmine bool) bool {
+ ismining := self.miner.Mining()
+ if shouldmine && !ismining {
+ self.miner.Start()
+ }
+ if ismining && !shouldmine {
+ self.miner.Stop()
+ }
+ return self.miner.Mining()
+}
+
func (self *XEth) IsListening() bool {
return self.eth.IsListening()
}