From 4fc60f340f6ef5ffe68e684ed44e5974fa08e8c8 Mon Sep 17 00:00:00 2001 From: obscuren Date: Sun, 29 Jun 2014 10:43:56 +0200 Subject: [PATCH] Wait for catchup when starting the miner --- utils/cmd.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/cmd.go b/utils/cmd.go index c084542b41..1d97c96396 100644 --- a/utils/cmd.go +++ b/utils/cmd.go @@ -204,6 +204,10 @@ func StartMining(ethereum *eth.Ethereum) bool { miner = ethminer.NewDefaultMiner(addr, ethereum) // Give it some time to connect with peers time.Sleep(3 * time.Second) + for !ethereum.IsUpToDate() == false { + time.Sleep(5 * time.Second) + } + logger.Infoln("Miner started") miner := ethminer.NewDefaultMiner(addr, ethereum) miner.Start()