Fixed cppcheck error

This commit is contained in:
SChernykh 2024-05-20 19:17:19 +02:00
parent 710f6c2eb7
commit 2b7febf5d0

View file

@ -699,27 +699,27 @@ void p2pool::submit_aux_block() const
ReadLock lock(m_mergeMiningClientsLock);
IMergeMiningClient::ChainParameters params;
IMergeMiningClient::ChainParameters chain_params;
for (IMergeMiningClient* c : m_mergeMiningClients) {
if (!c->get_params(params)) {
if (!c->get_params(chain_params)) {
continue;
}
if (chain_id == params.aux_id) {
if (chain_id == chain_params.aux_id) {
std::vector<hash> proof;
uint32_t path;
if (m_blockTemplate->get_aux_proof(template_id, extra_nonce, params.aux_hash, proof, path)) {
if (m_blockTemplate->get_aux_proof(template_id, extra_nonce, chain_params.aux_hash, proof, path)) {
if (pool_block_debug()) {
const MinerData data = miner_data();
const uint32_t n_aux_chains = static_cast<uint32_t>(data.aux_chains.size() + 1);
const uint32_t index = get_aux_slot(params.aux_id, data.aux_nonce, n_aux_chains);
const uint32_t index = get_aux_slot(chain_params.aux_id, data.aux_nonce, n_aux_chains);
if (!verify_merkle_proof(params.aux_hash, proof, index, n_aux_chains, merge_mining_root)) {
if (!verify_merkle_proof(chain_params.aux_hash, proof, index, n_aux_chains, merge_mining_root)) {
LOGERR(0, "submit_aux_block: verify_merkle_proof (1) failed for chain_id " << chain_id);
}
if (!verify_merkle_proof(params.aux_hash, proof, path, merge_mining_root)) {
if (!verify_merkle_proof(chain_params.aux_hash, proof, path, merge_mining_root)) {
LOGERR(0, "submit_aux_block: verify_merkle_proof (2) failed for chain_id " << chain_id);
}
}