diff options
author | zelig <viktor.tron@gmail.com> | 2014-07-15 07:05:18 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2014-07-15 07:05:18 +0800 |
commit | 94b12f7804bfb32763c9bbbce323af5d84c74910 (patch) | |
tree | 64bf3d2a6cd199bbc8c2cb643acd3a43f6a2aa89 /utils | |
parent | 353ecbb7d78d9669c42545f152f291f869b39c02 (diff) | |
download | dexon-94b12f7804bfb32763c9bbbce323af5d84c74910.tar.gz dexon-94b12f7804bfb32763c9bbbce323af5d84c74910.tar.zst dexon-94b12f7804bfb32763c9bbbce323af5d84c74910.zip |
fix start mining
Diffstat (limited to 'utils')
-rw-r--r-- | utils/cmd.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/utils/cmd.go b/utils/cmd.go index 889726b04..dfd867d64 100644 --- a/utils/cmd.go +++ b/utils/cmd.go @@ -124,6 +124,7 @@ func NewDatabase() ethutil.Database { } func NewClientIdentity(clientIdentifier, version, customIdentifier string) *ethwire.SimpleClientIdentity { + logger.Infoln("identity created") return ethwire.NewSimpleClientIdentity(clientIdentifier, version, customIdentifier) } @@ -209,10 +210,10 @@ var miner ethminer.Miner func StartMining(ethereum *eth.Ethereum) bool { if !ethereum.Mining { ethereum.Mining = true - addr := ethereum.KeyManager().Address() go func() { + logger.Infoln("Start mining") miner = ethminer.NewDefaultMiner(addr, ethereum) // Give it some time to connect with peers time.Sleep(3 * time.Second) @@ -220,8 +221,6 @@ func StartMining(ethereum *eth.Ethereum) bool { time.Sleep(5 * time.Second) } - logger.Infoln("Miner started") - miner := ethminer.NewDefaultMiner(addr, ethereum) miner.Start() }() RegisterInterrupt(func(os.Signal) { @@ -235,7 +234,7 @@ func StartMining(ethereum *eth.Ethereum) bool { func StopMining(ethereum *eth.Ethereum) bool { if ethereum.Mining { miner.Stop() - logger.Infoln("Miner stopped") + logger.Infoln("Stopped mining") ethereum.Mining = false return true } |