Beispiel #1
0
            private static void ConnectCallback(object sender, EventArgs e)
            {
                try
                {
                    if (AlgorithmRates == null || _niceHashData == null)
                    {
                        _niceHashData  = new NiceHashData();
                        AlgorithmRates = _niceHashData.NormalizedSma();
                    }
                    //send login
                    var version = "NHML/" + Application.ProductVersion;
                    var login   = new nicehash_login
                    {
                        version = version
                    };
                    var loginJson = JsonConvert.SerializeObject(login);
                    SendData(loginJson);

                    DeviceStatus_Tick(null); // Send device to populate rig stats

                    OnConnectionEstablished.Emit(null, EventArgs.Empty);
                }
                catch (Exception er)
                {
                    Helpers.ConsolePrint("SOCKET", er.ToString());
                }
            }
Beispiel #2
0
 private static void zSetAlgorithmRates(zPoolAlgo[] data)
 {
     try
     {
         if (niceHashData == null)
         {
             niceHashData = new NiceHashData(data);
         }
         foreach (var algo in data)
         {
             niceHashData.AppendPayingForAlgo((AlgorithmType)algo.NiceHashAlgoId(), (double)algo.MidPoint24HrEstimate);
         }
         AlgorithmRates = niceHashData.NormalizedSMA();
         OnSMAUpdate.Emit(null, EventArgs.Empty);
     }
     catch (Exception e)
     {
         Helpers.ConsolePrint("SOCKET", e.ToString());
     }
 }