Merge branch 'StriderDM-merge_mining_tag_fix' into dev

This commit is contained in:
XMRig 2021-10-13 05:43:27 +07:00
commit e90e7febfb
No known key found for this signature in database
GPG key ID: 446A53638BE94409
3 changed files with 24 additions and 13 deletions

View file

@ -72,7 +72,14 @@ int64_t xmrig::SelfSelectClient::submit(const JobResult &result)
submitOriginDaemon(result);
}
return m_client->submit(result);
uint64_t submit_result = m_client->submit(result);
if (m_submitToOrigin) {
// Ensure that the latest block template is available after block submission
getBlockTemplate();
}
return submit_result;
}
@ -285,9 +292,6 @@ void xmrig::SelfSelectClient::submitOriginDaemon(const JobResult& result)
LOG_INFO("%s " GREEN_BOLD("submitted to origin daemon") " (%" PRId64 "/%" PRId64 ") "
" diff " WHITE("%" PRIu64) " vs. " WHITE("%" PRIu64),
Tags::origin(), m_originSubmitted, m_originNotSubmitted, m_blockDiff, result.actualDiff(), result.diff);
// Ensure that the latest block template is available after block submission
getBlockTemplate();
}
void xmrig::SelfSelectClient::onHttpData(const HttpData &data)

View file

@ -245,6 +245,8 @@ bool xmrig::BlockTemplate::parse(bool hashes)
while (ar_extra.index() < m_extraSize) {
uint64_t extra_tag = 0;
uint64_t size = 0;
ar_extra(extra_tag);
switch (extra_tag) {
@ -254,12 +256,15 @@ bool xmrig::BlockTemplate::parse(bool hashes)
break;
case 0x02: // TX_EXTRA_NONCE
{
uint64_t size = 0;
ar_extra(size);
setOffset(TX_EXTRA_NONCE_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
ar_extra(m_txExtraNonce, size);
}
break;
case 0x03: // TX_EXTRA_MERGE_MINING_TAG
ar_extra(size);
setOffset(TX_EXTRA_MERGE_MINING_TAG_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
ar_extra(m_txMergeMiningTag, size + kKeySize);
break;
default:

View file

@ -54,6 +54,7 @@ public:
TX_EXTRA_OFFSET,
TX_PUBKEY_OFFSET,
TX_EXTRA_NONCE_OFFSET,
TX_EXTRA_MERGE_MINING_TAG_OFFSET,
OFFSET_COUNT
};
@ -86,6 +87,7 @@ public:
inline uint64_t outputType() const { return m_outputType; }
inline const Span &ephPublicKey() const { return m_ephPublicKey; }
inline const Span &txExtraNonce() const { return m_txExtraNonce; }
inline const Span &txMergeMiningTag() const { return m_txMergeMiningTag; }
// Transaction hashes
inline uint64_t numHashes() const { return m_numHashes; }
@ -140,7 +142,7 @@ private:
Span m_ephPublicKey;
uint64_t m_extraSize = 0;
Span m_txExtraNonce;
Span m_txMergeMiningTag = 0;
uint64_t m_numHashes = 0;
Buffer m_hashes;
Buffer m_minerTxMerkleTreeBranch;