void Miner_WorkAccepted(IPool arg1, IPoolWork arg2, IMiningDevice arg3) { this.UpdateHashrate(arg1); MiningDeviceData data; if (DeviceMap.TryGetValue(arg3, out data)) { data.UpdatedHashRate(arg3); } }
void Miner_WorkRejected(IPool arg1, IPoolWork arg2, IMiningDevice arg3, IShareResponse arg4) { this.UpdateHashrate(arg1); MiningDeviceData data; if (DeviceMap.TryGetValue(arg3, out data)) { data.UpdatedHashRate(arg3); } }
private void RemoveDevice(object obj) { Tuple <IMiningDeviceManager, IMiningDevice> t = obj as Tuple <IMiningDeviceManager, IMiningDevice>; MiningDeviceData data; if (DeviceMap.TryGetValue(t.Item2, out data)) { data.Done(); Devices.Remove(data); DeviceMap.Remove(t.Item2); } }