JSON RPC API: added seed_hash

It is required to verify RandomX PoW
This commit is contained in:
SChernykh
2024-05-24 17:05:50 +02:00
parent d0107ed148
commit 4acc9d09b8
2 changed files with 5 additions and 3 deletions

View File

@@ -283,7 +283,7 @@ bool MergeMiningClientJSON_RPC::parse_merge_mining_get_aux_block(const char* dat
return true;
}
void MergeMiningClientJSON_RPC::submit_solution(const BlockTemplate* /*block_tpl*/, 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, uint32_t merkle_proof_path)
void MergeMiningClientJSON_RPC::submit_solution(const BlockTemplate* /*block_tpl*/, 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, uint32_t merkle_proof_path)
{
ReadLock lock(m_lock);
@@ -303,7 +303,8 @@ void MergeMiningClientJSON_RPC::submit_solution(const BlockTemplate* /*block_tpl
s << '"' << merkle_proof[i] << '"';
}
s << "],\"path\":" << merkle_proof_path << "}}";
s << "],\"path\":" << merkle_proof_path
<< ",\"seed_hash\":\"" << seed_hash << "\"}}";
JSONRPCRequest::call(m_host, m_port, std::string(buf.data(), s.m_pos), std::string(), m_pool->params().m_socks5Proxy,
[this](const char* data, size_t size, double) {