aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
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()
}