NiceHashMiner.Miners.MiningSession.CheckIfShouldMine C# (CSharp) Method

CheckIfShouldMine() private method

private CheckIfShouldMine ( double CurrentProfit, bool log = true ) : bool
CurrentProfit double
log bool
return bool
        private bool CheckIfShouldMine(double CurrentProfit, bool log = true)
        {
            // if profitable and connected to internet mine
            bool shouldMine = CheckIfProfitable(CurrentProfit, log) && IsConnectedToInternet;
            if (shouldMine) {
                _mainFormRatesComunication.HideNotProfitable();
            } else {
                if (!IsConnectedToInternet) {
                    // change msg
                    if (log) Helpers.ConsolePrint(TAG, "NO INTERNET!!! Stopping mining.");
                    _mainFormRatesComunication.ShowNotProfitable(International.GetText("Form_Main_MINING_NO_INTERNET_CONNECTION"));
                } else {
                    _mainFormRatesComunication.ShowNotProfitable(International.GetText("Form_Main_MINING_NOT_PROFITABLE"));
                }
                // return don't group
                StopAllMinersNonProfitable();
            }
            return shouldMine;
        }