diff options
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r-- | xeth/xeth.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go index 67dac948c..f3569e454 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -103,6 +103,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() } |