setBlob should run after setAlgorithm

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

View File

@@ -247,6 +247,10 @@ bool xmrig::DaemonClient::parseJob(const rapidjson::Value &params, int *code)
Cvt::toHex(m_blockhashingblob.data() + offset * 2, kBlobReserveSize * 2, Cvt::randomBytes(kBlobReserveSize).data(), kBlobReserveSize);
}
if (m_pool.coin().isValid()) {
job.setAlgorithm(m_pool.coin().algorithm(job.blob()[0]));
}
if (blocktemplate.isNull() || !job.setBlob(m_blockhashingblob)) {
*code = 4;
return false;
@@ -257,10 +261,6 @@ bool xmrig::DaemonClient::parseJob(const rapidjson::Value &params, int *code)
job.setDiff(Json::getUint64(params, "difficulty"));
job.setId(blocktemplate.data() + blocktemplate.size() - 32);
if (m_pool.coin().isValid()) {
job.setAlgorithm(m_pool.coin().algorithm(job.blob()[0]));
}
m_job = std::move(job);
m_blocktemplate = std::move(blocktemplate);
m_prevHash = Json::getString(params, "prev_hash");