diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-20 01:58:15 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-20 01:58:15 +0800 |
commit | a59cd94625f589bb167be7a9c4588ff959dcfc00 (patch) | |
tree | fb7a4c697b6814da60f8cae29d0d497951e741f6 /xeth | |
parent | 605dd3a9820bb74be883afe3cb0e462aca40b32d (diff) | |
download | dexon-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')
-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 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() } |