aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cmd.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils/cmd.go')
-rw-r--r--utils/cmd.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/utils/cmd.go b/utils/cmd.go
index 1e1599582..f4d613c29 100644
--- a/utils/cmd.go
+++ b/utils/cmd.go
@@ -234,7 +234,11 @@ func StartRpc(ethereum *eth.Ethereum, RpcPort int) {
}
}
-var miner ethminer.Miner
+var miner *ethminer.Miner
+
+func GetMiner() *ethminer.Miner {
+ return miner
+}
func StartMining(ethereum *eth.Ethereum) bool {
if !ethereum.Mining {
@@ -263,7 +267,7 @@ func StartMining(ethereum *eth.Ethereum) bool {
}
func StopMining(ethereum *eth.Ethereum) bool {
- if ethereum.Mining {
+ if ethereum.Mining && miner != nil {
miner.Stop()
logger.Infoln("Miner stopped")
ethereum.Mining = false