diff --git a/src/consensus/funding.cpp b/src/consensus/funding.cpp index 59a2f4632..49aa1a0bf 100644 --- a/src/consensus/funding.cpp +++ b/src/consensus/funding.cpp @@ -44,6 +44,8 @@ std::set GetActiveFundingStreamElements( { std::set> requiredElements; for (int idx = Consensus::FIRST_FUNDING_STREAM; idx < Consensus::MAX_FUNDING_STREAMS; idx++) { + // The following indexed access is safe as Consensus::MAX_FUNDING_STREAMS is used + // in the definition of vFundingStreams. auto fs = params.vFundingStreams[idx]; // Funding period is [startHeight, endHeight) if (fs && nHeight >= fs.get().GetStartHeight() && nHeight < fs.get().GetEndHeight()) { diff --git a/src/consensus/params.cpp b/src/consensus/params.cpp index ee9cc6dac..d4a4adf2d 100644 --- a/src/consensus/params.cpp +++ b/src/consensus/params.cpp @@ -24,7 +24,6 @@ namespace Consensus { // floor((height - SlowStartShift) / PreBlossomHalvingInterval), if not IsBlossomActivated(height) // floor((BlossomActivationHeight - SlowStartShift) / PreBlossomHalvingInterval + (height - BlossomActivationHeight) / PostBlossomHalvingInterval), otherwise if (NetworkUpgradeActive(nHeight, Consensus::UPGRADE_BLOSSOM)) { - int64_t blossomActivationHeight = vUpgrades[Consensus::UPGRADE_BLOSSOM].nActivationHeight; // Ideally we would say: // halvings = (blossomActivationHeight - consensusParams.SubsidySlowStartShift()) / consensusParams.nPreBlossomSubsidyHalvingInterval diff --git a/src/main.cpp b/src/main.cpp index ca9e33626..089fe9d88 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -906,7 +906,7 @@ bool ContextualCheckTransaction( // From Canopy onward, coinbase transaction must include outputs corresponding to the // ZIP 207 consensus funding streams active at the current block height. To avoid // double-decrypting, we detect any shielded funding streams during the Heartwood - // consensus check. If Canopy is not yet active, requiredStreams will be empty. + // consensus check. If Canopy is not yet active, fundingStreamElements will be empty. std::set fundingStreamElements; if (canopyActive) { fundingStreamElements = Consensus::GetActiveFundingStreamElements(