pass Consensus::Params& to ReceivedBlockTransactions()
This commit is contained in:
parent
70f6f56e9d
commit
25660e91ef
1 changed files with 4 additions and 4 deletions
|
@ -2676,7 +2676,7 @@ CBlockIndex* AddToBlockIndex(const CBlockHeader& block)
|
|||
}
|
||||
|
||||
/** Mark a block as having its data received and checked (up to BLOCK_VALID_TRANSACTIONS). */
|
||||
bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBlockIndex *pindexNew, const CDiskBlockPos& pos)
|
||||
static bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBlockIndex *pindexNew, const CDiskBlockPos& pos, const Consensus::Params& consensusParams)
|
||||
{
|
||||
pindexNew->nTx = block.vtx.size();
|
||||
pindexNew->nChainTx = 0;
|
||||
|
@ -2684,7 +2684,7 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl
|
|||
pindexNew->nDataPos = pos.nPos;
|
||||
pindexNew->nUndoPos = 0;
|
||||
pindexNew->nStatus |= BLOCK_HAVE_DATA;
|
||||
if (IsWitnessEnabled(pindexNew->pprev, Params().GetConsensus())) {
|
||||
if (IsWitnessEnabled(pindexNew->pprev, consensusParams)) {
|
||||
pindexNew->nStatus |= BLOCK_OPT_WITNESS;
|
||||
}
|
||||
pindexNew->RaiseValidity(BLOCK_VALID_TRANSACTIONS);
|
||||
|
@ -3206,7 +3206,7 @@ static bool AcceptBlock(const std::shared_ptr<const CBlock>& pblock, CValidation
|
|||
if (dbp == NULL)
|
||||
if (!WriteBlockToDisk(block, blockPos, chainparams.MessageStart()))
|
||||
AbortNode(state, "Failed to write block");
|
||||
if (!ReceivedBlockTransactions(block, state, pindex, blockPos))
|
||||
if (!ReceivedBlockTransactions(block, state, pindex, blockPos, chainparams.GetConsensus()))
|
||||
return error("AcceptBlock(): ReceivedBlockTransactions failed");
|
||||
} catch (const std::runtime_error& e) {
|
||||
return AbortNode(state, std::string("System error: ") + e.what());
|
||||
|
@ -3837,7 +3837,7 @@ bool InitBlockIndex(const CChainParams& chainparams)
|
|||
if (!WriteBlockToDisk(block, blockPos, chainparams.MessageStart()))
|
||||
return error("LoadBlockIndex(): writing genesis block to disk failed");
|
||||
CBlockIndex *pindex = AddToBlockIndex(block);
|
||||
if (!ReceivedBlockTransactions(block, state, pindex, blockPos))
|
||||
if (!ReceivedBlockTransactions(block, state, pindex, blockPos, chainparams.GetConsensus()))
|
||||
return error("LoadBlockIndex(): genesis block not accepted");
|
||||
// Force a chainstate write so that when we VerifyDB in a moment, it doesn't check stale data
|
||||
return FlushStateToDisk(state, FLUSH_STATE_ALWAYS);
|
||||
|
|
Loading…
Reference in a new issue