Code cleanup.

This commit is contained in:
XMRig 2021-10-13 05:43:05 +07:00
parent 35ba786e63
commit 733b85a132
No known key found for this signature in database
GPG key ID: 446A53638BE94409

View file

@ -245,31 +245,28 @@ 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) {
case 0x01: // TX_EXTRA_TAG_PUBKEY
{
setOffset(TX_PUBKEY_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
ar_extra.skip(kKeySize);
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
{
uint64_t size = 0;
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:
return false; // TODO(SChernykh): handle other tags
}