Wait for catchup when starting the miner
This commit is contained in:
		| @@ -204,6 +204,10 @@ func StartMining(ethereum *eth.Ethereum) bool { | |||||||
| 			miner = ethminer.NewDefaultMiner(addr, ethereum) | 			miner = ethminer.NewDefaultMiner(addr, ethereum) | ||||||
| 			// Give it some time to connect with peers | 			// Give it some time to connect with peers | ||||||
| 			time.Sleep(3 * time.Second) | 			time.Sleep(3 * time.Second) | ||||||
|  | 			for !ethereum.IsUpToDate() == false { | ||||||
|  | 				time.Sleep(5 * time.Second) | ||||||
|  | 			} | ||||||
|  |  | ||||||
| 			logger.Infoln("Miner started") | 			logger.Infoln("Miner started") | ||||||
| 			miner := ethminer.NewDefaultMiner(addr, ethereum) | 			miner := ethminer.NewDefaultMiner(addr, ethereum) | ||||||
| 			miner.Start() | 			miner.Start() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user