@@ -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
@@ -531,9 +532,11 @@ std::vector<CQuorumCPtr> CQuorumManager::ScanQuorums(Consensus::LLMQType llmqTyp
531532 return ScanQuorums (llmqType, pindex, nCountRequested);
532533}
533534
534- std::vector<CQuorumCPtr> CQuorumManager::ScanQuorums (Consensus::LLMQType llmqType, const CBlockIndex* pindexStart, size_t nCountRequested) const
535+ std::vector<CQuorumCPtr> CQuorumManager::ScanQuorums (Consensus::LLMQType llmqType,
536+ gsl::not_null<const CBlockIndex*> pindexStart,
537+ size_t nCountRequested) const
535538{
536- if (pindexStart == nullptr || nCountRequested == 0 || !IsQuorumTypeEnabled (llmqType, pindexStart)) {
539+ if (nCountRequested == 0 || !IsQuorumTypeEnabled (llmqType, pindexStart)) {
537540 return {};
538541 }
539542
@@ -680,7 +683,7 @@ CQuorumCPtr CQuorumManager::GetQuorum(Consensus::LLMQType llmqType, gsl::not_nul
680683 return BuildQuorumFromCommitment (llmqType, pQuorumBaseBlockIndex, populate_cache);
681684}
682685
683- size_t CQuorumManager::GetQuorumRecoveryStartOffset (const CQuorum& quorum, const CBlockIndex* pIndex) const
686+ size_t CQuorumManager::GetQuorumRecoveryStartOffset (const CQuorum& quorum, gsl::not_null< const CBlockIndex*> pIndex) const
684687{
685688 assert (m_mn_activeman);
686689
@@ -924,7 +927,7 @@ void CQuorumManager::StartCachePopulatorThread(CQuorumCPtr pQuorum) const
924927}
925928
926929void CQuorumManager::StartQuorumDataRecoveryThread (CConnman& connman, CQuorumCPtr pQuorum,
927- const CBlockIndex* pIndex, uint16_t nDataMaskIn) const
930+ gsl::not_null< const CBlockIndex*> pIndex, uint16_t nDataMaskIn) const
928931{
929932 assert (m_mn_activeman);
930933
@@ -1093,7 +1096,7 @@ static void DataCleanupHelper(CDBWrapper& db, std::set<uint256> skip_list, bool
10931096 }
10941097}
10951098
1096- void CQuorumManager::StartCleanupOldQuorumDataThread (const CBlockIndex* pIndex) const
1099+ void CQuorumManager::StartCleanupOldQuorumDataThread (gsl::not_null< const CBlockIndex*> pIndex) const
10971100{
10981101 // Note: this function is CPU heavy and we don't want it to be running during DKGs.
10991102 // The largest dkgMiningWindowStart for a related quorum type is 42 (LLMQ_60_75).
@@ -1102,7 +1105,7 @@ void CQuorumManager::StartCleanupOldQuorumDataThread(const CBlockIndex* pIndex)
11021105 // window and it's better to have more room so we pick next cycle.
11031106 // dkgMiningWindowStart for small quorums is 10 i.e. a safe block to start
11041107 // these calculations is at height 576 + 24 * 2 + 10 = 576 + 58.
1105- if ((m_mn_activeman == nullptr && !m_quorums_watch) || pIndex == nullptr || (pIndex->nHeight % 576 != 58 )) {
1108+ if ((m_mn_activeman == nullptr && !m_quorums_watch) || (pIndex->nHeight % 576 != 58 )) {
11061109 return ;
11071110 }
11081111
0 commit comments