Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Zephyr solo mining: handle multiple outputs #3358

Merged
merged 1 commit into from
Nov 15, 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
36 changes: 21 additions & 15 deletions src/base/tools/cryptonote/BlockTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy