public void WorkComplete(Client solver, bool solutionFound, uint solution) { mEventLog.RecordClientWork(solver); WorkBlock block = solver.mCurrentBlock; block.mHashMan.FinishBlock(solver.mHashBlock); solver.mHashBlock = null; if (solutionFound && mBlock == block) { mBlocksSubmitted++; bool success = mUpstream.SubmitWork(block, solution); //if (!success) // success = mUpstream.SubmitWork(block, (uint)IPAddress.HostToNetworkOrder((int)solution)); // Start a new block if (success) { // Send email notification about this found solution /* * TimeSpan span = DateTime.Now - block.mHashMan.mStartTime; * string hashrate = string.Format("{0:N}", block.mHashMan.mHashesDone / span.TotalSeconds); * string body = "Found solution for " + block.mCurrency + " block: \n" + block.ToString() + "\n\n"; * body += "Solution string: " + data + "\n"; * body += "Block Accepted: " + success.ToString() + "\n"; * body += "Hashes Done: " + block.mHashMan.mHashesDone + "\n"; * body += "Time Spent: " + span.ToString() + "\n"; * body += "Hashrate: " + hashrate + "\n"; * body += "Clients: " + mClients.Count + "\n"; * body += "\n\n"; * //mMailer.SendEmail(body); */ //mMailer.SendEmail("Block Accepted"); string data = block.GetSolutionString(solution); mEventLog.RecordEvent(EventLog.EventType.Upstream, string.Format("Work accepted! solution: {0}, dataString: {1}", solution, data)); BeginBlock(); mBlocksAccepted++; } else { string data = block.GetSolutionString(solution); mEventLog.RecordEvent(EventLog.EventType.Upstream, string.Format("Work not accepted. solution: {0}, dataString: {1}", solution, data)); } } }