Example #1
0
        public void Update(Connection conn)
        {
            if (mCurrentWork != null)
            {
                bool threadsAllDone = true;
                foreach (WorkThread t in mThreads)
                {
                    if (!t.IsWorkDone())
                    {
                        threadsAllDone = false;
                        break;
                    }
                }

                if (threadsAllDone)
                {
                    uint hashes = 0;
                    uint solution = 0;
                    bool solutionFound = false;

                    foreach (WorkThread t in mThreads)
                    {
                        hashes += t.HashesDone;
                        if (t.SolutionFound)
                        {
                            solutionFound = true;
                            solution = t.Solution;
                        }
                    }

                    conn.SendWorkComplete(solutionFound, Scrypt.ByteReverse(solution), hashes);
                    mCurrentWork = null;
                    mTimer.Stop();
                    mHashRate = (uint)((double)hashes / mTimer.GetDuration());
                }
            }
        }
Example #2
0
 public Miner(string memberName, string productName, string platform, int threadCount = 1, bool useSSE = false, float gpuPercentage = 0)
 {
     mMTM = new MTM(threadCount, useSSE, gpuPercentage);
     mConn = new Connection(memberName, productName, platform);
     mConn.ConnectTo(mHostName);
 }