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

CheckIfProfitable() private method

private CheckIfProfitable ( double CurrentProfit, bool log = true ) : bool
CurrentProfit double
log bool
return bool
        private bool CheckIfProfitable(double CurrentProfit, bool log = true)
        {
            // TODO FOR NOW USD ONLY
            var currentProfitUSD = (CurrentProfit * Globals.BitcoinRate);
            IsProfitable =
                IsMiningRegardlesOfProfit
                || !IsMiningRegardlesOfProfit && currentProfitUSD >= ConfigManager.GeneralConfig.MinimumProfit;
            if (log) {
                Helpers.ConsolePrint(TAG, "Current Global profit: " + currentProfitUSD.ToString("F8") + " USD/Day");
                if (!IsProfitable) {
                    Helpers.ConsolePrint(TAG, "Current Global profit: NOT PROFITABLE MinProfit " + ConfigManager.GeneralConfig.MinimumProfit.ToString("F8") + " USD/Day");
                } else {
                    string profitabilityInfo = IsMiningRegardlesOfProfit ? "mine always regardless of profit" : ConfigManager.GeneralConfig.MinimumProfit.ToString("F8") + " USD/Day";
                    Helpers.ConsolePrint(TAG, "Current Global profit: IS PROFITABLE MinProfit " + profitabilityInfo);
                }
            }
            return IsProfitable;
        }