Fixed broken "coin" setting functionality

This commit is contained in:
SChernykh 2021-04-06 23:02:10 +02:00
parent 5126cc1414
commit c080d5b962
3 changed files with 19 additions and 7 deletions

View file

@ -130,12 +130,17 @@ bool xmrig::SelfSelectClient::parseResponse(int64_t id, rapidjson::Value &result
}
}
if (!m_job.setBlob(result[kBlockhashingBlob].GetString())) {
return false;
const char *blobData = Json::getString(result, kBlockhashingBlob);
if (pool().coin().isValid()) {
uint8_t blobVersion = 0;
if (blobData) {
Cvt::fromHex(&blobVersion, 1, blobData, 2);
}
m_job.setAlgorithm(pool().coin().algorithm(blobVersion));
}
if (pool().coin().isValid()) {
m_job.setAlgorithm(pool().coin().algorithm(m_job.blob()[0]));
if (!m_job.setBlob(blobData)) {
return false;
}
m_job.setHeight(Json::getUint64(result, kHeight));