Skip to content

Commit 381917f

Browse files
committed
Merge #8347: Trivial: Make CBlockIndex param const in ContextualCheckBlockHeader and ContextualCheckBlock
6f3d616 Trivial: Make CBlockIndex param const in ContextualCheckBlockHeader and ContextualCheckBlock (Jorge Timón)
2 parents 04af3cf + 6f3d616 commit 381917f

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
@@ -3502,7 +3502,7 @@ std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBloc
35023502
return commitment;
35033503
}
35043504

3505-
bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, CBlockIndex * const pindexPrev, int64_t nAdjustedTime)
3505+
bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev, int64_t nAdjustedTime)
35063506
{
35073507
// Check proof of work
35083508
if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams))
@@ -3525,7 +3525,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
35253525
return true;
35263526
}
35273527

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

src/main.h

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

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

0 commit comments

Comments
 (0)