Example #1
0
        public static CredentialsValidState GetCredentialsValidState()
        {
            // assume it is valid
            var ret = CredentialsValidState.VALID;

            if (!CredentialValidators.ValidateBitcoinAddress(ConfigManager.GeneralConfig.BitcoinAddress))
            {
                ret |= CredentialsValidState.INVALID_BTC;
            }
            if (!CredentialValidators.ValidateWorkerName(ConfigManager.GeneralConfig.WorkerName))
            {
                ret |= CredentialsValidState.INVALID_WORKER;
            }

            return(ret);
        }
Example #2
0
 // make sure to pass in trimmedBtc
 public static SetResult SetBTCIfValidOrDifferent(string btc, bool skipCredentialsSet = false)
 {
     if (btc == ConfigManager.GeneralConfig.BitcoinAddress && btc != "")
     {
         return(SetResult.NOTHING_TO_CHANGE);
     }
     if (!CredentialValidators.ValidateBitcoinAddress(btc))
     {
         ConfigManager.GeneralConfig.BitcoinAddress = btc;
         return(SetResult.INVALID);
     }
     SetBTC(btc);
     if (!skipCredentialsSet)
     {
         ResetNiceHashStatsCredentials();
     }
     return(SetResult.CHANGED);
 }