mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-24 12:39:28 +00:00
Also support variant received as string.
This commit is contained in:
parent
3df99fbced
commit
be232fa1f2
2 changed files with 9 additions and 1 deletions
|
@ -127,6 +127,7 @@ void xmrig::Algorithm::parseAlgorithm(const char *algo)
|
|||
void xmrig::Algorithm::parseVariant(const char *variant)
|
||||
{
|
||||
if (m_algo == CRYPTONIGHT_HEAVY) {
|
||||
m_variant = VARIANT_0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -274,7 +274,14 @@ bool Client::parseJob(const rapidjson::Value ¶ms, int *code)
|
|||
}
|
||||
|
||||
if (params.HasMember("variant")) {
|
||||
job.algorithm().parseVariant(params["variant"].GetInt());
|
||||
const rapidjson::Value &variant = params["variant"];
|
||||
|
||||
if (variant.IsInt()) {
|
||||
job.algorithm().parseVariant(variant.GetInt());
|
||||
}
|
||||
else if (variant.IsString()){
|
||||
job.algorithm().parseVariant(variant.GetString());
|
||||
}
|
||||
}
|
||||
|
||||
if (!verifyAlgorithm(job.algorithm())) {
|
||||
|
|
Loading…
Reference in a new issue