diff --git a/src/llmq/chainlocks.cpp b/src/llmq/chainlocks.cpp index 34f8bdb7e4..528d90b6d1 100644 --- a/src/llmq/chainlocks.cpp +++ b/src/llmq/chainlocks.cpp @@ -136,7 +136,7 @@ void CChainLocksHandler::ProcessNewChainLock(const NodeId from, const llmq::CCha return; } - CBlockIndex* pindex = WITH_LOCK(cs_main, return m_chainstate.m_blockman.LookupBlockIndex(clsig.getBlockHash())); + const CBlockIndex* pindex = WITH_LOCK(cs_main, return m_chainstate.m_blockman.LookupBlockIndex(clsig.getBlockHash())); { LOCK(cs); @@ -424,14 +424,14 @@ CChainLocksHandler::BlockTxs::mapped_type CChainLocksHandler::GetBlockTxs(const uint32_t blockTime; { LOCK(cs_main); - auto* pindex = m_chainstate.m_blockman.LookupBlockIndex(blockHash); + const auto* pindex = m_chainstate.m_blockman.LookupBlockIndex(blockHash); CBlock block; if (!ReadBlockFromDisk(block, pindex, Params().GetConsensus())) { return nullptr; } ret = std::make_shared>(); - for (auto& tx : block.vtx) { + for (const auto& tx : block.vtx) { if (tx->IsCoinBase() || tx->vin.empty()) { continue; } @@ -630,7 +630,7 @@ void CChainLocksHandler::Cleanup() } for (auto it = blockTxs.begin(); it != blockTxs.end(); ) { - auto* pindex = m_chainstate.m_blockman.LookupBlockIndex(it->first); + const auto* pindex = m_chainstate.m_blockman.LookupBlockIndex(it->first); if (InternalHasChainLock(pindex->nHeight, pindex->GetBlockHash())) { for (const auto& txid : *it->second) { txFirstSeenTime.erase(txid); @@ -649,7 +649,7 @@ void CChainLocksHandler::Cleanup() // tx has vanished, probably due to conflicts it = txFirstSeenTime.erase(it); } else if (!hashBlock.IsNull()) { - auto* pindex = m_chainstate.m_blockman.LookupBlockIndex(hashBlock); + const auto* pindex = m_chainstate.m_blockman.LookupBlockIndex(hashBlock); if (m_chainstate.m_chain.Tip()->GetAncestor(pindex->nHeight) == pindex && m_chainstate.m_chain.Height() - pindex->nHeight >= 6) { // tx got confirmed >= 6 times, so we can stop keeping track of it it = txFirstSeenTime.erase(it);