예제 #1
0
        static void Main(string[] args)
        {
            while (true)
            {
                try
                {
                    _pool = SelectPool();
                    _work = GetWork();
                    while (true)
                    {
                        if (_work == null || _work.Age > _maxAgeTicks)
                            _work = GetWork();

                        if (_work.FindShare(ref _nonce, _batchSize))
                        {
                            SendShare(_work.Current);
                            _work = null;
                        }
                        else
                            PrintCurrentState();
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine();
                    Console.Write("ERROR: ");
                    Console.WriteLine(e.Message);
                }
                Console.WriteLine();
                Console.Write("Hit 'Enter' to try again...");
                Console.ReadLine();
            }
        }