From 7f1b8493949a1553434d1fb0afe5028343077fc9 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Mon, 13 Jun 2022 07:30:59 +0200 Subject: [PATCH] Fixed new cppcheck issues --- src/side_chain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/side_chain.cpp b/src/side_chain.cpp index ca11635..f7c46fb 100644 --- a/src/side_chain.cpp +++ b/src/side_chain.cpp @@ -347,7 +347,7 @@ bool SideChain::get_shares(PoolBlock* tip, std::vector& shares) cons } cur = it->second; - } while (block_depth < m_chainWindowSize); + } while (true); // Combine shares with the same wallet addresses std::sort(shares.begin(), shares.end(), [](const auto& a, const auto& b) { return *a.m_wallet < *b.m_wallet; }); @@ -1579,6 +1579,7 @@ bool SideChain::is_longer_chain(const PoolBlock* block, const PoolBlock* candida } } + // cppcheck-suppress knownConditionTrueFalse while (block_ancestor && candidate_ancestor) { if (block_ancestor->m_parent == candidate_ancestor->m_parent) { // If they are really on the same chain, we can just compare cumulative difficulties