diff --git a/cppcheck/suppressions.txt b/cppcheck/suppressions.txt index 2ca2561..2ce6461 100644 --- a/cppcheck/suppressions.txt +++ b/cppcheck/suppressions.txt @@ -7,3 +7,4 @@ constParameterReference constVariableReference functionStatic constParameter +shadowVariable diff --git a/src/block_template.cpp b/src/block_template.cpp index b1f1fc9..c25dae4 100644 --- a/src/block_template.cpp +++ b/src/block_template.cpp @@ -391,7 +391,7 @@ void BlockTemplate::update(const MinerData& data, const Mempool& mempool, const // DEBUG: Show share/reward assignment for (size_t i = 0; i < m_shares.size(); ++i) { - LOGINFO(3, "BlockTemplate share[" << i << "]: spend_key=" << m_shares[i].m_wallet->spend_public_key() << " weight=" << m_shares[i].m_weight << " reward=" << m_rewards[i]); + LOGINFO(5, "BlockTemplate share[" << i << "]: spend_key=" << m_shares[i].m_wallet->spend_public_key() << " weight=" << m_shares[i].m_weight << " reward=" << m_rewards[i]); } auto get_reward_amounts_weight = [this]() { @@ -662,7 +662,7 @@ void BlockTemplate::update(const MinerData& data, const Mempool& mempool, const m_transactionHashes.reserve(HASH_SIZE * 2 + mempool_txs.size()); m_transactionHashes.insert(m_transactionHashes.end(), miner_tx_hash.h, miner_tx_hash.h + HASH_SIZE); - LOGINFO(3, "Stored miner TX hash at position 0: " << miner_tx_hash); + LOGINFO(5, "Stored miner TX hash at position 0: " << miner_tx_hash); // Write protocol tx bytes to blob writeVarint(4, m_blockTemplateBlob); // version @@ -679,7 +679,7 @@ void BlockTemplate::update(const MinerData& data, const Mempool& mempool, const // Calculate protocol tx hash and store in member variable calculate_protocol_tx_hash(data.height, m_protocolTxHash); - LOGINFO(3, "Protocol TX hash: " << m_protocolTxHash); + LOGINFO(5, "Protocol TX hash: " << m_protocolTxHash); // Add protocol tx hash after miner tx m_transactionHashes.insert(m_transactionHashes.end(), m_protocolTxHash.h, m_protocolTxHash.h + HASH_SIZE); @@ -797,7 +797,7 @@ void BlockTemplate::update(const MinerData& data, const Mempool& mempool, const if (pool_block_debug()) { - LOGINFO(3, "DEBUG: pool_block_debug() is TRUE - executing debug block"); + LOGINFO(5, "DEBUG: pool_block_debug() is TRUE - executing debug block"); const size_t merkle_root_offset = m_extraNonceOffsetInTemplate + m_poolBlockTemplate->m_extraNonceSize + 2 + m_poolBlockTemplate->m_merkleTreeDataSize; @@ -1198,7 +1198,7 @@ int BlockTemplate::create_miner_tx(const MinerData& data, const std::vector(hex_buf)); + LOGINFO(5, static_cast(hex_buf)); // Pre-Carrot: original logic with patching const size_t extra_nonce_offset = m_extraNonceOffsetInTemplate - m_minerTxOffsetInTemplate; @@ -1444,12 +1444,12 @@ hash BlockTemplate::calc_miner_tx_hash(uint32_t extra_nonce) const snprintf(prunable_hash_hex + static_cast(i) * 2, 3, "%02x", hashes[64 + i]); snprintf(final_hash_hex + static_cast(i) * 2, 3, "%02x", result.h[i]); } - LOGINFO(3, "Miner TX hash components:"); - LOGINFO(3, " Prefix hash: " << static_cast(prefix_hash_hex)); - LOGINFO(3, " Base RCT hash: " << static_cast(base_rct_hash_hex)); - LOGINFO(3, " Prunable hash: " << static_cast(prunable_hash_hex)); - LOGINFO(3, " Final TX hash: " << static_cast(final_hash_hex)); - LOGINFO(3, " Prefix size: " << prefix_size << ", Base RCT size: " << base_rct_size << ", Total TX size: " << m_minerTxSize); + LOGINFO(5, "Miner TX hash components:"); + LOGINFO(5, " Prefix hash: " << static_cast(prefix_hash_hex)); + LOGINFO(5, " Base RCT hash: " << static_cast(base_rct_hash_hex)); + LOGINFO(5, " Prunable hash: " << static_cast(prunable_hash_hex)); + LOGINFO(5, " Final TX hash: " << static_cast(final_hash_hex)); + LOGINFO(5, " Prefix size: " << prefix_size << ", Base RCT size: " << base_rct_size << ", Total TX size: " << m_minerTxSize); return result; } @@ -1465,7 +1465,7 @@ void BlockTemplate::calc_merkle_tree_main_branch() if (count == 2) { hash protocol_hash; memcpy(protocol_hash.h, h + HASH_SIZE, HASH_SIZE); - LOGINFO(3, "Merkle branch protocol tx hash: " << protocol_hash); + LOGINFO(5, "Merkle branch protocol tx hash: " << protocol_hash); m_merkleTreeMainBranch.insert(m_merkleTreeMainBranch.end(), h + HASH_SIZE, h + HASH_SIZE * 2); } else { diff --git a/src/side_chain.cpp b/src/side_chain.cpp index c69c581..942e79b 100644 --- a/src/side_chain.cpp +++ b/src/side_chain.cpp @@ -3341,7 +3341,7 @@ void SideChain::reset_to_checkpoint(uint64_t checkpoint_height) // Forget deleted blocks so they can be re-downloaded from peers { - MutexLock lock(m_incomingBlocksLock); + MutexLock incomingLock(m_incomingBlocksLock); for (const auto& [id, full_id] : blocks_to_remove) { m_incomingBlocks.erase(full_id); }