mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-25 20:16:05 +00:00
Fixed many "new job" messages when solo mining
Fix for https://github.com/xmrig/xmrig/issues/2127
This commit is contained in:
parent
0b7dfaabe0
commit
91ad6fcf3d
2 changed files with 24 additions and 4 deletions
|
@ -179,13 +179,31 @@ void xmrig::DaemonClient::onHttpData(const HttpData &data)
|
||||||
return send(kGetInfo);
|
return send(kGetInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isOutdated(Json::getUint64(doc, kHeight), Json::getString(doc, kHash))) {
|
const uint64_t height = Json::getUint64(doc, kHeight);
|
||||||
|
const String hash = Json::getString(doc, kHash);
|
||||||
|
|
||||||
|
if (isOutdated(height, hash)) {
|
||||||
|
// Multiple /getheight responses can come at once resulting in multiple getBlockTemplate() calls
|
||||||
|
if ((height != m_blocktemplateRequestHeight) || (hash != m_blocktemplateRequestHash)) {
|
||||||
|
m_blocktemplateRequestHeight = height;
|
||||||
|
m_blocktemplateRequestHash = hash;
|
||||||
getBlockTemplate();
|
getBlockTemplate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (data.url == kGetInfo && isOutdated(Json::getUint64(doc, kHeight), Json::getString(doc, "top_block_hash"))) {
|
}
|
||||||
|
else if (data.url == kGetInfo) {
|
||||||
|
const uint64_t height = Json::getUint64(doc, kHeight);
|
||||||
|
const String hash = Json::getString(doc, "top_block_hash");
|
||||||
|
|
||||||
|
if (isOutdated(height, hash)) {
|
||||||
|
// Multiple /getinfo responses can come at once resulting in multiple getBlockTemplate() calls
|
||||||
|
if ((height != m_blocktemplateRequestHeight) || (hash != m_blocktemplateRequestHash)) {
|
||||||
|
m_blocktemplateRequestHeight = height;
|
||||||
|
m_blocktemplateRequestHash = hash;
|
||||||
getBlockTemplate();
|
getBlockTemplate();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,8 @@ private:
|
||||||
String m_tlsFingerprint;
|
String m_tlsFingerprint;
|
||||||
String m_tlsVersion;
|
String m_tlsVersion;
|
||||||
Timer *m_timer;
|
Timer *m_timer;
|
||||||
|
uint64_t m_blocktemplateRequestHeight = 0;
|
||||||
|
String m_blocktemplateRequestHash;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue