mirror of
https://github.com/xmrig/xmrig.git
synced 2026-02-01 09:43:03 -05:00
Update BlockTemplate class.
This commit is contained in:
@@ -352,16 +352,16 @@ void xmrig::Job::generateHashingBlob(String &blob) const
|
||||
{
|
||||
uint8_t root_hash[32];
|
||||
const uint8_t* p = m_minerTxPrefix.data();
|
||||
BlockTemplate::CalculateRootHash(p, p + m_minerTxPrefix.size(), m_minerTxMerkleTreeBranch, root_hash);
|
||||
BlockTemplate::calculateRootHash(p, p + m_minerTxPrefix.size(), m_minerTxMerkleTreeBranch, root_hash);
|
||||
|
||||
uint64_t root_hash_offset = nonceOffset() + nonceSize();
|
||||
|
||||
if (m_hasMinerSignature) {
|
||||
root_hash_offset += BlockTemplate::SIGNATURE_SIZE + 2 /* vote */;
|
||||
root_hash_offset += BlockTemplate::kSignatureSize + 2 /* vote */;
|
||||
}
|
||||
|
||||
blob = rawBlob();
|
||||
Cvt::toHex(blob.data() + root_hash_offset * 2, 64, root_hash, BlockTemplate::HASH_SIZE);
|
||||
Cvt::toHex(blob.data() + root_hash_offset * 2, 64, root_hash, BlockTemplate::kHashSize);
|
||||
}
|
||||
|
||||
|
||||
@@ -374,7 +374,7 @@ void xmrig::Job::generateMinerSignature(const uint8_t* blob, size_t size, uint8_
|
||||
memcpy(tmp, blob, size);
|
||||
|
||||
// Fill signature with zeros
|
||||
memset(tmp + nonceOffset() + nonceSize(), 0, BlockTemplate::SIGNATURE_SIZE);
|
||||
memset(tmp + nonceOffset() + nonceSize(), 0, BlockTemplate::kSignatureSize);
|
||||
|
||||
uint8_t prefix_hash[32];
|
||||
xmrig::keccak(tmp, static_cast<int>(size), prefix_hash, sizeof(prefix_hash));
|
||||
|
||||
Reference in New Issue
Block a user