Skip to content

Commit

Permalink
chainstate: Set nFlags for proof-of-stake blocks in LoadExternalBlock…
Browse files Browse the repository at this point in the history
…File()
  • Loading branch information
lateminer committed Jan 30, 2024
1 parent 5e7b46c commit bc0af21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4803,6 +4803,10 @@ void Chainstate::LoadExternalBlockFile(
blkdat >> *pblock;
nRewind = blkdat.GetPos();

// Set nFlags in case of proof of stake block
if (pblock->IsProofOfStake())
pblock->nFlags |= CBlockIndex::BLOCK_PROOF_OF_STAKE;

BlockValidationState state;
if (AcceptBlock(pblock, state, nullptr, true, dbp, nullptr, true)) {
nLoaded++;
Expand Down Expand Up @@ -4841,6 +4845,7 @@ void Chainstate::LoadExternalBlockFile(
LogPrint(BCLog::REINDEX, "%s: Processing out of order child %s of %s\n", __func__, pblockrecursive->GetHash().ToString(),
head.ToString());
LOCK(cs_main);

BlockValidationState dummy;
if (AcceptBlock(pblockrecursive, dummy, nullptr, true, &it->second, nullptr, true)) {
nLoaded++;
Expand Down

0 comments on commit bc0af21

Please sign in to comment.