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 #48 from theLosers106/master
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
kenshirothefist committed Mar 13, 2016
2 parents b2f9185 + 5cc8c2f commit c485046
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 16 deletions.
1 change: 0 additions & 1 deletion NiceHashMiner/DriverVersionConfirmationDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion NiceHashMiner/Ethereum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,19 @@ public static bool StartProxy(bool writeconfig, string url, string username)
P.StartInfo.UseShellExecute = !Config.ConfigData.HideMiningWindows;
P.EnableRaisingEvents = true;
P.Exited += P_Exited;

if (Config.ConfigData.HideMiningWindows)
{
P.StartInfo.FileName = "cmd";
P.StartInfo.Arguments = " /C \" " + EtherProxyPath + " " + EtherProxyConfigPath + "\"";
}

try { P.Start(); }
catch { return false; }
catch
{
Helpers.ConsolePrint("Ethereum", "StartProxy: Failed to start proxy..");
return false;
}
ProcessProxyHandle = P;

EtherMinerRunning = 1;
Expand Down Expand Up @@ -187,6 +198,12 @@ public static void StopProxy()
try { ProcessProxyHandle.Kill(); }
catch { Helpers.ConsolePrint("Ethereum", "StopProxy: " + "Ethereum proxy failed to exit.."); }

foreach (Process process in Process.GetProcessesByName("ether-proxy"))
{
try { process.Kill(); }
catch { Helpers.ConsolePrint("Ethereum", "StopProxy: " + "Ethereum proxy failed to exit.."); }
}

ProcessProxyHandle.Close();
ProcessProxyHandle = null;
EtherMinerRunning = 0;
Expand Down
6 changes: 3 additions & 3 deletions NiceHashMiner/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ void SMACheck_Tick(object sender, EventArgs e)

if (t == null && NiceHashData == null && ShowWarningNiceHashData)
{
ShowWarningNiceHashData = false;
DialogResult dialogResult = MessageBox.Show("NiceHash Miner requires internet connection to run. " +
"Please ensure that you are connected to the " +
"internet before running NiceHash Miner. " +
Expand All @@ -556,10 +557,7 @@ void SMACheck_Tick(object sender, EventArgs e)
MessageBoxButtons.YesNo);

if (dialogResult == DialogResult.Yes)
{
ShowWarningNiceHashData = false;
return;
}
else if (dialogResult == DialogResult.No)
System.Windows.Forms.Application.Exit();
}
Expand Down Expand Up @@ -625,6 +623,8 @@ private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
if (m.CurrentAlgo >= 0)
{
algo = m.SupportedAlgorithms[m.CurrentAlgo].NiceHashID;
// Hack for Ethereum
if (algo == 19) algo = 999;
break;
}
}
Expand Down
1 change: 0 additions & 1 deletion NiceHashMiner/Form3.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion NiceHashMiner/Form4.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion NiceHashMiner/MinerFileNotFoundDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion NiceHashMiner/NiceHashStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class nicehash_global_stats
public class nicehash_stats
{
public double balance;
public double balance_unexchanged;
public double balance_immature;
public double balance_confirmed;
public double accepted_speed;
public double rejected_speed;
public int algo;
Expand Down Expand Up @@ -130,7 +133,18 @@ public static double GetBalance(string btc, string worker)
{
nhjson_current = JsonConvert.DeserializeObject<nicehash_json<nicehash_stats>>(r1);
for (int i = 0; i < nhjson_current.result.stats.Length; i++)
balance += nhjson_current.result.stats[i].balance;
{
if (nhjson_current.result.stats[i].algo != 999)
{
balance += nhjson_current.result.stats[i].balance;
}
else if (nhjson_current.result.stats[i].algo == 999 && l == 0)
{
balance += nhjson_current.result.stats[i].balance_unexchanged +
nhjson_current.result.stats[i].balance_immature +
nhjson_current.result.stats[i].balance_confirmed;
}
}
}
catch
{
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.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyVersion("1.3.0.1")]
[assembly: AssemblyFileVersion("1.3.0.1")]
4 changes: 3 additions & 1 deletion NiceHashMiner/ccminer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ protected override string BenchmarkCreateCommandLine(int index, int time)
{
CommandLine = " --benchmark --benchmark-warmup 10 --benchmark-trial 20" +
" " + ExtraLaunchParameters +
" " + SupportedAlgorithms[index].ExtraLaunchParameters +
" --cuda --cuda-devices ";

for (int i = 0; i < CDevs.Count; i++)
Expand All @@ -49,7 +50,7 @@ protected override string BenchmarkCreateCommandLine(int index, int time)
}
else
{
CommandLine = "--algo=" + SupportedAlgorithms[index].MinerName +
CommandLine = " --algo=" + SupportedAlgorithms[index].MinerName +
" --benchmark" +
" --time-limit " + time.ToString() +
" " + ExtraLaunchParameters +
Expand Down Expand Up @@ -95,6 +96,7 @@ public override void Start(int nhalgo, string url, string username)

LastCommandLine = " --cuda -F http://127.0.0.1:" + Config.ConfigData.APIBindPortEthereumProxy + "/miner/10/" + MinerDeviceName + " " +
" " + ExtraLaunchParameters +
" " + Algo.ExtraLaunchParameters +
" --dag-dir " + Config.ConfigData.DAGDirectory + "\\" + MinerDeviceName +
" --cuda-devices ";

Expand Down
10 changes: 6 additions & 4 deletions NiceHashMiner/sgminer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ protected override string BenchmarkCreateCommandLine(int index, int time)
{
CommandLine = " --opencl --opencl-platform " + GPUPlatformNumber +
" " + ExtraLaunchParameters +
" " + Algo.ExtraLaunchParameters +
" --benchmark --benchmark-warmup 10 --benchmark-trial 20";
}
else
Expand All @@ -299,12 +300,12 @@ protected override string BenchmarkCreateCommandLine(int index, int time)
Form1.MiningLocation[Config.ConfigData.Location] + ".nicehash.com:" +
Form1.NiceHashData[SupportedAlgorithms[index].NiceHashID].port;

string username = Config.ConfigData.BitcoinAddress;
string username = Config.ConfigData.BitcoinAddress.Trim();
if (Config.ConfigData.WorkerName.Length > 0)
username += "." + Config.ConfigData.WorkerName;
username += "." + Config.ConfigData.WorkerName.Trim();

CommandLine = " /C \"cd /d " + DirName + " && sgminer.exe " +
"--gpu-platform " + GPUPlatformNumber +
" --gpu-platform " + GPUPlatformNumber +
" -k " + SupportedAlgorithms[index].MinerName +
" --url=" + url +
" --userpass=" + username + ":" + GetPassword(Algo) +
Expand Down Expand Up @@ -358,6 +359,7 @@ public override void Start(int nhalgo, string url, string username)
WorkingDirectory = "";
LastCommandLine = " --opencl --opencl-platform " + GPUPlatformNumber +
" " + ExtraLaunchParameters +
" " + Algo.ExtraLaunchParameters +
" -F http://127.0.0.1:" + Config.ConfigData.APIBindPortEthereumProxy + "/miner/10/" + MinerDeviceName +
" --dag-dir " + Config.ConfigData.DAGDirectory + "\\" + MinerDeviceName;
}
Expand All @@ -368,7 +370,7 @@ public override void Start(int nhalgo, string url, string username)
Path = "sgminer.exe";
WorkingDirectory = GetMinerDirectory(Algo.NiceHashName);

LastCommandLine = "--gpu-platform " + GPUPlatformNumber +
LastCommandLine = " --gpu-platform " + GPUPlatformNumber +
" -k " + Algo.MinerName +
" --url=" + url +
" --userpass=" + username + ":" + GetPassword(Algo) +
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ GPU 0 failure, disabling!
Ethminer is running on all of my AMD GPUs including ones that are unticked from the miner
> This is a limitation in the ethminer where in order to pick individual GPU, the ethminer would have to be run in multiple instances. To disable a certain GPU from mining, please disable the GPU directly from the Device Manager.
My benchmarking resutls are not accurate
> Any kind of automation can only be done up to a particular level. We've spent significant effort to make benchmarking as good as possible, but it can't be made ideal. First of all, make sure to run Precise benchmark if Standard benchmark is not giving you satisfactory results. If you still see a deviation of actual mining speed from the one, calculated from benchmark, then you should manually enter these observed speed numbers from actual mining into config.json file or set them via the "Settings" button.
# <a name="bugs"></a> How to report bugs and issues?

To report bugs and issues please use the GitHub issue reporting tool: https://github.com/nicehash/NiceHashMiner/issues. Any bugs and issues reports are very much appreciated since it helps us to improve NiceHash Miner. Thank you.
Expand Down

0 comments on commit c485046

Please sign in to comment.