@@ -251,9 +251,9 @@ void CQuorumManager::Stop()
251251 workerPool.stop (true );
252252}
253253
254- void CQuorumManager::TriggerQuorumDataRecoveryThreads (CConnman& connman, const CBlockIndex* pIndex) const
254+ void CQuorumManager::TriggerQuorumDataRecoveryThreads (CConnman& connman, gsl::not_null< const CBlockIndex*> pIndex) const
255255{
256- if ((m_mn_activeman == nullptr && !m_quorums_watch) || !m_quorums_recovery || pIndex == nullptr ) {
256+ if ((m_mn_activeman == nullptr && !m_quorums_watch) || !m_quorums_recovery) {
257257 return ;
258258 }
259259
@@ -304,6 +304,7 @@ void CQuorumManager::TriggerQuorumDataRecoveryThreads(CConnman& connman, const C
304304
305305void CQuorumManager::UpdatedBlockTip (const CBlockIndex* pindexNew, CConnman& connman, bool fInitialDownload ) const
306306{
307+ if (!pindexNew) return ;
307308 if (!m_mn_sync.IsBlockchainSynced ()) return ;
308309
309310 for (const auto & params : Params ().GetConsensus ().llmqs ) {
@@ -328,7 +329,7 @@ void CQuorumManager::UpdatedBlockTip(const CBlockIndex* pindexNew, CConnman& con
328329}
329330
330331void CQuorumManager::CheckQuorumConnections (CConnman& connman, const Consensus::LLMQParams& llmqParams,
331- const CBlockIndex* pindexNew) const
332+ gsl::not_null< const CBlockIndex*> pindexNew) const
332333{
333334 if (m_mn_activeman == nullptr && !m_quorums_watch) return ;
334335
@@ -530,9 +531,11 @@ std::vector<CQuorumCPtr> CQuorumManager::ScanQuorums(Consensus::LLMQType llmqTyp
530531 return ScanQuorums (llmqType, pindex, nCountRequested);
531532}
532533
533- std::vector<CQuorumCPtr> CQuorumManager::ScanQuorums (Consensus::LLMQType llmqType, const CBlockIndex* pindexStart, size_t nCountRequested) const
534+ std::vector<CQuorumCPtr> CQuorumManager::ScanQuorums (Consensus::LLMQType llmqType,
535+ gsl::not_null<const CBlockIndex*> pindexStart,
536+ size_t nCountRequested) const
534537{
535- if (pindexStart == nullptr || nCountRequested == 0 || !m_chainman.IsQuorumTypeEnabled (llmqType, pindexStart)) {
538+ if (nCountRequested == 0 || !m_chainman.IsQuorumTypeEnabled (llmqType, pindexStart)) {
536539 return {};
537540 }
538541
@@ -679,7 +682,7 @@ CQuorumCPtr CQuorumManager::GetQuorum(Consensus::LLMQType llmqType, gsl::not_nul
679682 return BuildQuorumFromCommitment (llmqType, pQuorumBaseBlockIndex, populate_cache);
680683}
681684
682- size_t CQuorumManager::GetQuorumRecoveryStartOffset (const CQuorum& quorum, const CBlockIndex* pIndex) const
685+ size_t CQuorumManager::GetQuorumRecoveryStartOffset (const CQuorum& quorum, gsl::not_null< const CBlockIndex*> pIndex) const
683686{
684687 assert (m_mn_activeman);
685688
@@ -922,7 +925,7 @@ void CQuorumManager::StartCachePopulatorThread(CQuorumCPtr pQuorum) const
922925}
923926
924927void CQuorumManager::StartQuorumDataRecoveryThread (CConnman& connman, CQuorumCPtr pQuorum,
925- const CBlockIndex* pIndex, uint16_t nDataMaskIn) const
928+ gsl::not_null< const CBlockIndex*> pIndex, uint16_t nDataMaskIn) const
926929{
927930 assert (m_mn_activeman);
928931
@@ -1091,7 +1094,7 @@ static void DataCleanupHelper(CDBWrapper& db, std::set<uint256> skip_list, bool
10911094 }
10921095}
10931096
1094- void CQuorumManager::StartCleanupOldQuorumDataThread (const CBlockIndex* pIndex) const
1097+ void CQuorumManager::StartCleanupOldQuorumDataThread (gsl::not_null< const CBlockIndex*> pIndex) const
10951098{
10961099 // Note: this function is CPU heavy and we don't want it to be running during DKGs.
10971100 // The largest dkgMiningWindowStart for a related quorum type is 42 (LLMQ_60_75).
@@ -1100,7 +1103,7 @@ void CQuorumManager::StartCleanupOldQuorumDataThread(const CBlockIndex* pIndex)
11001103 // window and it's better to have more room so we pick next cycle.
11011104 // dkgMiningWindowStart for small quorums is 10 i.e. a safe block to start
11021105 // these calculations is at height 576 + 24 * 2 + 10 = 576 + 58.
1103- if ((m_mn_activeman == nullptr && !m_quorums_watch) || pIndex == nullptr || (pIndex->nHeight % 576 != 58 )) {
1106+ if ((m_mn_activeman == nullptr && !m_quorums_watch) || (pIndex->nHeight % 576 != 58 )) {
11041107 return ;
11051108 }
11061109
0 commit comments