From a59cd94625f589bb167be7a9c4588ff959dcfc00 Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Thu, 19 Feb 2015 18:58:15 +0100 Subject: Add setMining RPC method --- xeth/xeth.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'xeth') 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() } -- cgit