Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixes for Zephyr solo mining #553

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions src/base/tools/cryptonote/BlockTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ bool xmrig::BlockTemplate::parse(bool hashes)
}

if (m_coin == Coin::ZEPHYR) {
uint8_t #_record[24];
uint8_t #_record[120];
ar(#_record);
}

Expand All @@ -225,8 +225,12 @@ bool xmrig::BlockTemplate::parse(bool hashes)
ar(m_height);
ar(m_numOutputs);

const uint64_t expected_outputs = (m_coin == Coin::ZEPHYR) ? 2 : 1;
if (m_numOutputs != expected_outputs) {
if (m_coin == Coin::ZEPHYR) {
if (m_numOutputs < 2) {
return false;
}
}
else if (m_numOutputs != 1) {
return false;
}

Expand All @@ -252,23 +256,25 @@ bool xmrig::BlockTemplate::parse(bool hashes)
ar.skip(asset_type_len);
ar(m_viewTag);

uint64_t amount2;
ar(amount2);
for (uint64_t k = 1; k < m_numOutputs; ++k) {
uint64_t amount2;
ar(amount2);

uint8_t output_type2;
ar(output_type2);
if (output_type2 != 2) {
return false;
}
uint8_t output_type2;
ar(output_type2);
if (output_type2 != 2) {
return false;
}

Span key2;
ar(key2, kKeySize);
Span key2;
ar(key2, kKeySize);

ar(asset_type_len);
ar.skip(asset_type_len);
ar(asset_type_len);
ar.skip(asset_type_len);

uint8_t view_tag2;
ar(view_tag2);
uint8_t view_tag2;
ar(view_tag2);
}
}
else if (m_outputType == 3) {
ar(m_viewTag);
Expand Down