Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Merge pull request #68 from theLosers106/master
Browse files Browse the repository at this point in the history
Bug fix and improvements
  • Loading branch information
kenshirothefist committed Apr 4, 2016
2 parents 78127d0 + 540fa1b commit e0d3eaa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
5 changes: 1 addition & 4 deletions NiceHashMiner/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -614,9 +614,6 @@ private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
{
if (!VerifyMiningAddress()) return;

int location = comboBox1.SelectedIndex;
if (location > 1) location = 1;

int algo = 0;
// find first working algo
foreach (Miner m in Miners)
Expand All @@ -630,7 +627,7 @@ private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
}
}

System.Diagnostics.Process.Start("http://www.nicehash.com/index.jsp?p=miners&addr=" + textBox1.Text.Trim() + "&l=" + location + "&a=" + algo);
System.Diagnostics.Process.Start("http://www.nicehash.com/index.jsp?p=miners&addr=" + textBox1.Text.Trim() + "&a=" + algo);
}


Expand Down
22 changes: 7 additions & 15 deletions NiceHashMiner/NiceHashStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ public static NiceHashSMA[] GetAlgorithmRates(string worker)
}


public static nicehash_stats GetStats(string btc, int location, int algo, string worker)
public static nicehash_stats GetStats(string btc, int algo, string worker)
{
if (location > 1) location = 1;
string r1 = GetNiceHashAPIData("https://www.nicehash.com/api?method=stats.provider&location=" + location.ToString() + "&addr=" + btc, worker);
string r1 = GetNiceHashAPIData("https://www.nicehash.com/api?method=stats.provider&addr=" + btc, worker);
if (r1 == null) return null;

nicehash_json<nicehash_stats> nhjson_current;
Expand All @@ -123,11 +122,9 @@ public static double GetBalance(string btc, string worker)
{
double balance = 0;

for (int l = 0; l < 2; l++)
string r1 = GetNiceHashAPIData("https://www.nicehash.com/api?method=stats.provider&addr=" + btc, worker);
if (r1 != null)
{
string r1 = GetNiceHashAPIData("https://www.nicehash.com/api?method=stats.provider&location=" + l.ToString() + "&addr=" + btc, worker);
if (r1 == null) break;

nicehash_json<nicehash_stats> nhjson_current;
try
{
Expand All @@ -138,18 +135,13 @@ public static double GetBalance(string btc, string worker)
{
balance += nhjson_current.result.stats[i].balance;
}
else if (nhjson_current.result.stats[i].algo == 999 && l == 0)
else if (nhjson_current.result.stats[i].algo == 999)
{
balance += nhjson_current.result.stats[i].balance_unexchanged +
nhjson_current.result.stats[i].balance_immature +
nhjson_current.result.stats[i].balance_confirmed;
balance += nhjson_current.result.stats[i].balance_confirmed;
}
}
}
catch
{
break;
}
catch { }
}

return balance;
Expand Down
4 changes: 2 additions & 2 deletions NiceHashMiner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0.1")]
[assembly: AssemblyFileVersion("1.3.0.1")]
[assembly: AssemblyVersion("1.3.0.3")]
[assembly: AssemblyFileVersion("1.3.0.3")]
5 changes: 4 additions & 1 deletion NiceHashMiner/ccminer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ protected void QueryCDevs()
P.WaitForExit();

// Check for ethereum mining
if (this is ccminer_sp) AddEthereum(" 9");
if (CDevs.Count != 0)
{
if (this is ccminer_sp) AddEthereum(" 9");
}
}
catch (Exception e)
{
Expand Down

0 comments on commit e0d3eaa

Please sign in to comment.