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

Commit 07ec672

Browse files
committed
fix sgminer daggerhashimoto benchmark parsing
1 parent 34f5b98 commit 07ec672

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

NiceHashMiner/Miners/sgminer.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ protected override string BenchmarkCreateCommandLine(Algorithm algorithm, int ti
144144
}
145145

146146
protected override bool BenchmarkParseLine(string outdata) {
147-
if (outdata.Contains("Average hashrate:") && outdata.Contains("/s")) {
147+
if (outdata.Contains("Average hashrate:") && outdata.Contains("/s") && BenchmarkAlgorithm.NiceHashID != AlgorithmType.DaggerHashimoto) {
148148
int i = outdata.IndexOf(": ");
149149
int k = outdata.IndexOf("/s");
150150

@@ -161,6 +161,30 @@ protected override bool BenchmarkParseLine(string outdata) {
161161
speed *= 1000000;
162162

163163
BenchmarkAlgorithm.BenchmarkSpeed = speed;
164+
return true;
165+
} else if (outdata.Contains(String.Format("GPU{0}", MiningSetup.MiningPairs[0].Device.ID)) && outdata.Contains("s):") && BenchmarkAlgorithm.NiceHashID == AlgorithmType.DaggerHashimoto) {
166+
int i = outdata.IndexOf("s):");
167+
int k = outdata.IndexOf("(avg)");
168+
169+
// save speed
170+
string hashSpeed = outdata.Substring(i + 3, k - i + 3).Trim();
171+
hashSpeed = hashSpeed.Replace("(avg):", "");
172+
Helpers.ConsolePrint("BENCHMARK", "Final Speed: " + hashSpeed);
173+
174+
double mult = 1;
175+
if (hashSpeed.Contains("K")) {
176+
hashSpeed = hashSpeed.Replace("K", "");
177+
mult = 1000;
178+
} else if (hashSpeed.Contains("M")) {
179+
hashSpeed = hashSpeed.Replace("M", "");
180+
mult = 1000000;
181+
}
182+
183+
hashSpeed = hashSpeed.Substring(0, hashSpeed.IndexOf(" "));
184+
double speed = Double.Parse(hashSpeed, CultureInfo.InvariantCulture) * mult;
185+
186+
BenchmarkAlgorithm.BenchmarkSpeed = speed;
187+
164188
return true;
165189
}
166190
return false;

0 commit comments

Comments
 (0)