public void Stop() { // TODO thing about this case, closing opening on switching // EthlargementIntegratedPlugin.Instance.Stop(_miningPairs); MinerApiWatchdog.RemoveGroup(GroupKey); MiningStats.RemoveGroup(MiningPairs.Select(pair => pair.Device.UUID), _plugin.PluginUUID); IsRunning = false; _miner.StopMining(); //if (_miner is IDisposable disposableMiner) //{ // disposableMiner.Dispose(); //} }
private async Task StopAsync() { // TODO thing about this case, closing opening on switching EthlargementIntegratedPlugin.Instance.Stop(MiningPairs); MinerApiWatchdog.RemoveGroup(GroupKey); MiningDataStats.RemoveGroup(MiningPairs.Select(pair => pair.Device.UUID), _plugin.PluginUUID); await _miner.StopMiningTask(); _algos.ForEach(a => a.IsCurrentlyMining = false); //if (_miner is IDisposable disposableMiner) //{ // disposableMiner.Dispose(); //} }
// TAG for identifying miner public string MinerTag() { if (_minerTag == null) { const string mask = "{0}-MINER_ID({1})-DEVICE_IDs({2})"; // no devices set if (!IsInit) { return(string.Format(mask, MinerDeviceName, MinerID, "NOT_SET")); } // contains ids var ids = MiningPairs.Select(cdevs => cdevs.Device.ID.ToString()).ToList(); _minerTag = string.Format(mask, MinerDeviceName, MinerID, string.Join(",", ids)); } return(_minerTag); }