aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cmd.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils/cmd.go')
-rw-r--r--utils/cmd.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/cmd.go b/utils/cmd.go
index 638114bbe..f4d613c29 100644
--- a/utils/cmd.go
+++ b/utils/cmd.go
@@ -234,10 +234,10 @@ func StartRpc(ethereum *eth.Ethereum, RpcPort int) {
}
}
-var miner ethminer.Miner
+var miner *ethminer.Miner
func GetMiner() *ethminer.Miner {
- return &miner
+ return miner
}
func StartMining(ethereum *eth.Ethereum) bool {
@@ -267,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