Skip to content

Commit 6f3d616

Browse files
committed
Trivial: Make CBlockIndex param const in ContextualCheckBlockHeader and ContextualCheckBlock
1 parent bc94b87 commit 6f3d616

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3499,7 +3499,7 @@ std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBloc
34993499
return commitment;
35003500
}
35013501

3502-
bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, CBlockIndex * const pindexPrev, int64_t nAdjustedTime)
3502+
bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev, int64_t nAdjustedTime)
35033503
{
35043504
// Check proof of work
35053505
if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams))
@@ -3522,7 +3522,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
35223522
return true;
35233523
}
35243524

3525-
bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIndex * const pindexPrev)
3525+
bool ContextualCheckBlock(const CBlock& block, CValidationState& state, const CBlockIndex* pindexPrev)
35263526
{
35273527
const int nHeight = pindexPrev == NULL ? 0 : pindexPrev->nHeight + 1;
35283528
const Consensus::Params& consensusParams = Params().GetConsensus();

src/main.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ bool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::P
444444
/** Context-dependent validity checks.
445445
* By "context", we mean only the previous block headers, but not the UTXO
446446
* set; UTXO-related validity checks are done in ConnectBlock(). */
447-
bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, CBlockIndex* pindexPrev, int64_t nAdjustedTime);
448-
bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIndex *pindexPrev);
447+
bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev, int64_t nAdjustedTime);
448+
bool ContextualCheckBlock(const CBlock& block, CValidationState& state, const CBlockIndex* pindexPrev);
449449

450450
/** Apply the effects of this block (with given index) on the UTXO set represented by coins.
451451
* Validity checks that depend on the UTXO set are also done; ConnectBlock()

0 commit comments

Comments
 (0)