assert(pindex->GetBlockHash()==consensusParams.hashGenesisBlock);// Genesis block's hash must match.
assert(pindex==chainActive.Genesis());// The current active chain's genesis block must be this block.
}
if(pindex->nChainTx==0)assert(pindex->nSequenceId<=0);// nSequenceId can't be set positive for blocks that aren't linked (negative is used for preciousblock)
if(!pindex->HaveTxsDownloaded())assert(pindex->nSequenceId<=0);// nSequenceId can't be set positive for blocks that aren't linked (negative is used for preciousblock)
// VALID_TRANSACTIONS is equivalent to nTx > 0 for all nodes (whether or not pruning has occurred).
// HAVE_DATA is only equivalent to nTx > 0 (or VALID_TRANSACTIONS) if no pruning has occurred.
assert(((pindex->nStatus&BLOCK_VALID_MASK)>=BLOCK_VALID_TRANSACTIONS)==(pindex->nTx>0));// This is pruning-independent.
// All parents having had data (at some point) is equivalent to all parents being VALID_TRANSACTIONS, which is equivalent to nChainTx being set.
assert((pindexFirstNeverProcessed!=nullptr)==(pindex->nChainTx==0));// nChainTx != 0 is used to signal that all parent blocks have been processed (but may have been pruned).
assert(pindex->nHeight==nHeight);// nHeight must be consistent.
assert(pindex->pprev==nullptr||pindex->nChainWork>=pindex->pprev->nChainWork);// For every block except the genesis block, the chainwork must be larger than the parent's.
assert(nHeight<2||(pindex->pskip&&(pindex->pskip->nHeight<nHeight)));// The pskip pointer must point back for all but the first 2 blocks.