async fn wait_for_mode_change( engine: &Arc<MiningEngine>, current: Option<MiningMode>, ) -> MiningMode