Better handeling of miner restarts