Skip to content

Commit

Permalink
Merge branch 'bug/sgminer-rpc-api-error'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwoolls committed Nov 6, 2014
2 parents ee194c1 + 899d5d9 commit 01985d7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion MultiMiner.Xgminer.Api/Parsers/VersionInformationParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,20 @@ public static void ParseTextForVersionInformation(string text, MultiMiner.Xgmine

keyValuePairs = GetDictionaryFromTextChunk(responseParts[1]);

versionInformation.MinerVersion = keyValuePairs["CGMiner"];
string key = "CGMiner";
if (keyValuePairs.ContainsKey(key))
versionInformation.MinerVersion = keyValuePairs[key];
else
{
// SGMiner 4.0 broke compatibility with the CGMiner RPC API
// Version 5.0 fixed the issue - this work-around is for 4.0
// Request :"version"
// Response:"STATUS=S,When=1415068731,Code=22,Msg=SGMiner versions,Description=sgminer 4.1.0|VERSION,SGMiner=4.1.0,API=3.1|\u0000"
key = "SGMiner";
if (keyValuePairs.ContainsKey(key))
versionInformation.MinerVersion = keyValuePairs[key];
}

versionInformation.ApiVersion = keyValuePairs["API"];
}
}
Expand Down

0 comments on commit 01985d7

Please sign in to comment.