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

Commit e0d3eaa

Browse files
Merge pull request #68 from theLosers106/master
Bug fix and improvements
2 parents 78127d0 + 540fa1b commit e0d3eaa

File tree

4 files changed

+14
-22
lines changed

4 files changed

+14
-22
lines changed

NiceHashMiner/Form1.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,6 @@ private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
614614
{
615615
if (!VerifyMiningAddress()) return;
616616

617-
int location = comboBox1.SelectedIndex;
618-
if (location > 1) location = 1;
619-
620617
int algo = 0;
621618
// find first working algo
622619
foreach (Miner m in Miners)
@@ -630,7 +627,7 @@ private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
630627
}
631628
}
632629

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

636633

NiceHashMiner/NiceHashStats.cs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,9 @@ public static NiceHashSMA[] GetAlgorithmRates(string worker)
9494
}
9595

9696

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

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

126-
for (int l = 0; l < 2; l++)
125+
string r1 = GetNiceHashAPIData("https://www.nicehash.com/api?method=stats.provider&addr=" + btc, worker);
126+
if (r1 != null)
127127
{
128-
string r1 = GetNiceHashAPIData("https://www.nicehash.com/api?method=stats.provider&location=" + l.ToString() + "&addr=" + btc, worker);
129-
if (r1 == null) break;
130-
131128
nicehash_json<nicehash_stats> nhjson_current;
132129
try
133130
{
@@ -138,18 +135,13 @@ public static double GetBalance(string btc, string worker)
138135
{
139136
balance += nhjson_current.result.stats[i].balance;
140137
}
141-
else if (nhjson_current.result.stats[i].algo == 999 && l == 0)
138+
else if (nhjson_current.result.stats[i].algo == 999)
142139
{
143-
balance += nhjson_current.result.stats[i].balance_unexchanged +
144-
nhjson_current.result.stats[i].balance_immature +
145-
nhjson_current.result.stats[i].balance_confirmed;
140+
balance += nhjson_current.result.stats[i].balance_confirmed;
146141
}
147142
}
148143
}
149-
catch
150-
{
151-
break;
152-
}
144+
catch { }
153145
}
154146

155147
return balance;

NiceHashMiner/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.3.0.1")]
36-
[assembly: AssemblyFileVersion("1.3.0.1")]
35+
[assembly: AssemblyVersion("1.3.0.3")]
36+
[assembly: AssemblyFileVersion("1.3.0.3")]

NiceHashMiner/ccminer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ protected void QueryCDevs()
217217
P.WaitForExit();
218218

219219
// Check for ethereum mining
220-
if (this is ccminer_sp) AddEthereum(" 9");
220+
if (CDevs.Count != 0)
221+
{
222+
if (this is ccminer_sp) AddEthereum(" 9");
223+
}
221224
}
222225
catch (Exception e)
223226
{

0 commit comments

Comments
 (0)