aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/cmd.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/utils/cmd.go b/utils/cmd.go
index 5d0b3463c..0eeb1049e 100644
--- a/utils/cmd.go
+++ b/utils/cmd.go
@@ -127,6 +127,7 @@ func NewDatabase() ethutil.Database {
}
func NewClientIdentity(clientIdentifier, version, customIdentifier string) *ethwire.SimpleClientIdentity {
+ logger.Infoln("identity created")
return ethwire.NewSimpleClientIdentity(clientIdentifier, version, customIdentifier)
}
@@ -243,21 +244,18 @@ func GetMiner() *ethminer.Miner {
func StartMining(ethereum *eth.Ethereum) bool {
if !ethereum.Mining {
ethereum.Mining = true
-
addr := ethereum.KeyManager().Address()
go func() {
+ logger.Infoln("Start mining")
if miner == nil {
miner = ethminer.NewDefaultMiner(addr, ethereum)
}
-
// Give it some time to connect with peers
time.Sleep(3 * time.Second)
for !ethereum.IsUpToDate() {
time.Sleep(5 * time.Second)
}
-
- logger.Infoln("Miner started")
miner.Start()
}()
RegisterInterrupt(func(os.Signal) {
@@ -271,9 +269,7 @@ func StartMining(ethereum *eth.Ethereum) bool {
func StopMining(ethereum *eth.Ethereum) bool {
if ethereum.Mining && miner != nil {
miner.Stop()
-
- logger.Infoln("Miner stopped")
-
+ logger.Infoln("Stopped mining")
ethereum.Mining = false
return true