setBlob should run after setAlgorithm

This commit is contained in:
esrrhs 2021-03-29 12:11:03 +08:00
parent 69590f9777
commit d578a3828f
3 changed files with 13 additions and 13 deletions

View file

@ -377,6 +377,14 @@ bool xmrig::Client::parseJob(const rapidjson::Value &params, int *code)
return false;
}
const char *algo = Json::getString(params, "algo");
if (algo) {
job.setAlgorithm(algo);
}
else if (m_pool.coin().isValid()) {
job.setAlgorithm(m_pool.coin().algorithm(job.blob()[0]));
}
# ifdef XMRIG_FEATURE_HTTP
if (m_pool.mode() == Pool::MODE_SELF_SELECT) {
job.setExtraNonce(Json::getString(params, "extra_nonce"));
@ -401,14 +409,6 @@ bool xmrig::Client::parseJob(const rapidjson::Value &params, int *code)
return false;
}
const char *algo = Json::getString(params, "algo");
if (algo) {
job.setAlgorithm(algo);
}
else if (m_pool.coin().isValid()) {
job.setAlgorithm(m_pool.coin().algorithm(job.blob()[0]));
}
job.setHeight(Json::getUint64(params, "height"));
if (!verifyAlgorithm(job.algorithm(), algo)) {