예제 #1
0
 void SMACheck_Tick(object sender, EventArgs e)
 {
     Helpers.ConsolePrint("NICEHASH: sma get");
     NiceHashSMA[] t = NiceHashStats.GetAlgorithmRates(textBox1.Text.Trim() + "." + textBox2.Text.Trim());
     if (t != null)
     {
         NiceHashData = t;
     }
 }
예제 #2
0
        void SMACheck_Tick(object sender, EventArgs e)
        {
            string worker = textBox1.Text.Trim() + "." + textBox2.Text.Trim();

            Helpers.ConsolePrint("NICEHASH", "SMA get");
            NiceHashSMA[] t = NiceHashStats.GetAlgorithmRates(worker);

            for (int i = 0; i < 3; i++)
            {
                if (t != null)
                {
                    NiceHashData = t;
                    break;
                }

                Helpers.ConsolePrint("NICEHASH", "SMA get failed .. retrying");
                System.Threading.Thread.Sleep(1000);
                t = NiceHashStats.GetAlgorithmRates(worker);
            }

            if (t == null && NiceHashData == null && ShowWarningNiceHashData)
            {
                ShowWarningNiceHashData = false;
                DialogResult dialogResult = MessageBox.Show("NiceHash Miner requires internet connection to run. " +
                                                            "Please ensure that you are connected to the " +
                                                            "internet before running NiceHash Miner. " +
                                                            "Would you like to continue?",
                                                            "Check internet connection",
                                                            MessageBoxButtons.YesNo);

                if (dialogResult == DialogResult.Yes)
                {
                    return;
                }
                else if (dialogResult == DialogResult.No)
                {
                    System.Windows.Forms.Application.Exit();
                }
            }
        }
예제 #3
0
        void SMACheck_Tick(object sender, EventArgs e)
        {
            string worker = textBoxBTCAddress.Text.Trim() + "." + textBoxWorkerName.Text.Trim();

            Helpers.ConsolePrint("NICEHASH", "SMA get");
            Dictionary <AlgorithmType, NiceHashSMA> t = null;

            for (int i = 0; i < 5; i++)
            {
                t = NiceHashStats.GetAlgorithmRates(worker);
                if (t != null)
                {
                    Globals.NiceHashData = t;
                    break;
                }

                Helpers.ConsolePrint("NICEHASH", "SMA get failed .. retrying");
                System.Threading.Thread.Sleep(1000);
                t = NiceHashStats.GetAlgorithmRates(worker);
            }

            if (t == null && Globals.NiceHashData == null && ShowWarningNiceHashData)
            {
                ShowWarningNiceHashData = false;
                DialogResult dialogResult = MessageBox.Show(International.GetText("Form_Main_msgbox_NoInternetMsg"),
                                                            International.GetText("Form_Main_msgbox_NoInternetTitle"),
                                                            MessageBoxButtons.YesNo, MessageBoxIcon.Error);

                if (dialogResult == DialogResult.Yes)
                {
                    return;
                }
                else if (dialogResult == DialogResult.No)
                {
                    System.Windows.Forms.Application.Exit();
                }
            }
        }