SendWorkComplete() public method

public SendWorkComplete ( bool solutionFound, uint solution, uint hashesDone ) : void
solutionFound bool
solution uint
hashesDone uint
return void
Exemplo n.º 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());
                }
            }
        }
Exemplo n.º 2
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());
                }
            }
        }