Exemplo n.º 1
0
        // TODO this function is probably not at the right place now
        // We call this when we change BTC and Workername and this is most likely wrong
        public static void ResetNiceHashStatsCredentials()
        {
            // check if we have valid credentials
            var state = GetCredentialsValidState();

            if (state == CredentialsValidState.VALID)
            {
                // Reset credentials
                var(btc, worker, group) = ConfigManager.GeneralConfig.GetCredentials();
                NiceHashStats.SetCredentials(btc, worker, group);
            }
            else
            {
                // TODO notify invalid credentials?? send state?
            }
        }
Exemplo n.º 2
0
 private void TextBoxCheckBoxMain_Leave(object sender, EventArgs e)
 {
     if (VerifyMiningAddress(false))
     {
         if (ConfigManager.GeneralConfig.BitcoinAddress != textBoxBTCAddress.Text.Trim() ||
             ConfigManager.GeneralConfig.WorkerName != textBoxWorkerName.Text.Trim())
         {
             // Reset credentials
             NiceHashStats.SetCredentials(textBoxBTCAddress.Text.Trim(), textBoxWorkerName.Text.Trim());
         }
         // Commit to config.json
         ConfigManager.GeneralConfig.BitcoinAddress  = textBoxBTCAddress.Text.Trim();
         ConfigManager.GeneralConfig.WorkerName      = textBoxWorkerName.Text.Trim();
         ConfigManager.GeneralConfig.ServiceLocation = comboBoxLocation.SelectedIndex;
         ConfigManager.GeneralConfigFileCommit();
     }
 }
Exemplo n.º 3
0
 private void ConnectionEstablishedCallback(object sender, EventArgs e)
 {
     // send credentials
     NiceHashStats.SetCredentials(textBoxBTCAddress.Text.Trim(), textBoxWorkerName.Text.Trim());
 }