@@ -112,7 +112,8 @@ void CCreditPoolManager::AddToCache(const uint256& block_hash, int height, const
112112 }
113113}
114114
115- static std::optional<CBlock> GetBlockForCreditPool (const CBlockIndex* const block_index, const Consensus::Params& consensusParams)
115+ static std::optional<CBlock> GetBlockForCreditPool (const gsl::not_null<const CBlockIndex*> block_index,
116+ const Consensus::Params& consensusParams)
116117{
117118 // There's no CbTx before DIP0003 activation
118119 if (!DeploymentActiveAt (*block_index, Params ().GetConsensus (), Consensus::DEPLOYMENT_DIP0003)) {
@@ -132,7 +133,8 @@ static std::optional<CBlock> GetBlockForCreditPool(const CBlockIndex* const bloc
132133 return block;
133134}
134135
135- CCreditPool CCreditPoolManager::ConstructCreditPool (const CBlockIndex* const block_index, CCreditPool prev, const Consensus::Params& consensusParams)
136+ CCreditPool CCreditPoolManager::ConstructCreditPool (const gsl::not_null<const CBlockIndex*> block_index,
137+ CCreditPool prev, const Consensus::Params& consensusParams)
136138{
137139 std::optional<CBlock> block = GetBlockForCreditPool (block_index, consensusParams);
138140 if (!block) {
@@ -213,7 +215,7 @@ CCreditPool CCreditPoolManager::ConstructCreditPool(const CBlockIndex* const blo
213215
214216CCreditPool CCreditPoolManager::GetCreditPool (const CBlockIndex* block_index, const Consensus::Params& consensusParams)
215217{
216- std::stack<const CBlockIndex * > to_calculate;
218+ std::stack<gsl::not_null< const CBlockIndex*> > to_calculate;
217219
218220 std::optional<CCreditPool> poolTmp;
219221 while (block_index != nullptr && !(poolTmp = GetFromCache (*block_index)).has_value ()) {
0 commit comments