void OnWorkRejected(IPool arg1, IPoolWork arg2, IMiningDevice arg3, IShareResponse arg4) { if (this.WorkRejected != null) { this.WorkRejected(arg1, arg2, arg3, arg4); } }
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 OnWorkRejected(StratumWork work, IMiningDevice device, IShareResponse response, bool async = true) { if (this.WorkRejected != null) { if (async) { Task.Factory.StartNew(() => { this.WorkRejected(this, work, device, response); }); } else { this.WorkRejected(this, work, device, response); } } }
protected override void OnWorkRejected(IPool pool, IPoolWork work, IMiningDevice device, IShareResponse response) { base.OnWorkRejected(pool, work, device, response); if (response.JobNotFound || response.RejectReason.Contains("job not found") || response.RejectReason.Contains("stale")) { if (LogHelper.ShouldDisplay(LogVerbosity.Verbose)) { LogHelper.ConsoleLog(string.Format("Device {0} submitted stale share. Restarting with new work.", device.Name), LogVerbosity.Verbose); } this.RequestWork(device); } }
protected virtual void OnWorkRejected(IPool pool, IPoolWork work, IMiningDevice device, IShareResponse response) { if (!response.IsLowDifficlutyShare && !response.RejectReason.Contains("low difficulty") && !response.RejectReason.Contains("above target")) { device.Rejected++; device.RejectedWorkUnits += work.Diff; if (this.WorkRejected != null) { this.WorkRejected(pool, work, device, response); } } else { // Fix for bug where some pools will change the difficluty in the middle of a job and expect shares at the new difficluty if (pool.Diff > work.Diff) { LogHelper.DebugLogError(string.Format("Submitted share with low difficluty while pool diff was different than work diff. P: {0} W: {0}", pool.Diff, work.Diff)); LogHelper.DebugConsoleLog("Restarting work on all to attempt to synchronize difficluty.", ConsoleColor.Red, LogVerbosity.Quiet); IPoolWork newWork = work.Clone() as IPoolWork; newWork.Diff = pool.Diff; StartNewWork(newWork); } device.HardwareErrors++; device.DiscardedWorkUnits += work.Diff; if (this.ActivePool != null) { this.ActivePool.Rejected--; this.ActivePool.RejectedWorkUnits -= work.Diff; this.ActivePool.HardwareErrors++; this.ActivePool.DiscardedWorkUnits += work.Diff; } } DisplayDeviceStats(device); if (this.WorkDiscarded != null) { this.WorkDiscarded(pool, work, device); } }