Skip to content

Commit

Permalink
Fix: use correct nonce value
Browse files Browse the repository at this point in the history
  • Loading branch information
SChernykh committed May 9, 2024
1 parent fd953a0 commit f270b97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/merge_mining_client_tari.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ bool MergeMiningClientTari::get_params(ChainParameters& out_params) const
return true;
}

void MergeMiningClientTari::submit_solution(const uint8_t (&hashing_blob)[128], size_t nonce_offset, const hash& seed_hash, const std::vector<uint8_t>& /*blob*/, const std::vector<hash>& /*merkle_proof*/)
void MergeMiningClientTari::submit_solution(const uint8_t (&hashing_blob)[128], size_t nonce_offset, const hash& seed_hash, const std::vector<uint8_t>& blob, const std::vector<hash>& /*merkle_proof*/)
{
Block block;
{
Expand All @@ -140,14 +140,14 @@ void MergeMiningClientTari::submit_solution(const uint8_t (&hashing_blob)[128],
std::string data;

// Monero header + nonce
data.append(reinterpret_cast<const char*>(hashing_blob), nonce_offset + sizeof(uint32_t));
data.append(reinterpret_cast<const char*>(blob.data()), nonce_offset + sizeof(uint32_t));

// Monero seed
data.append(1, HASH_SIZE);
data.append(reinterpret_cast<const char*>(seed_hash.h), HASH_SIZE);

uint64_t transaction_count;
if (!readVarint(hashing_blob + nonce_offset + sizeof(uint32_t) + HASH_SIZE, hashing_blob + 128, transaction_count)) {
if (!readVarint(hashing_blob + nonce_offset + sizeof(uint32_t) + HASH_SIZE, hashing_blob + sizeof(hashing_blob), transaction_count)) {
return;
}

Expand Down

0 comments on commit f270b97

Please sign in to comment.