reference #6393
Is that what you meant @laanwj ?
reference #6393
669 | + assert(block); 670 | + 671 | + while (block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA)) 672 | block = block->pprev; 673 | 674 | obj.push_back(Pair("pruneheight", block->nHeight));
I don't know the context of this PR, but it seems to me this should just be block?block->nHeight:0
In that case, block won't be NULL... (I assume you're familiar with the trinary operator?)
Do you mean the ternary operator?
And yes, I understand the block won't be NULL... I'm not sure I understand what your point is?
Also, the commit message here sucks. Please explain what it's supposed to do and why...
What I meant in #6393 was that when execution reaches the part of AppInit2() where the RPC server is unlocked (meaning SetRPCWarmupFinished() is called), the code has made sure that chainActive.Tip() is not null. It either has successfully indexed the genesis block, or exit with an error. See also #5243.
This means that checks (or assertions) for chainActive.Tip() are not necessary in the RPC code (or anywhere else if AppInit2 is finished). No need to add this. Luckily, because there are tons of places in the code where it is blindly assumed that the tip contains a block.
But it doesn't really hurt either. I see no reason for changing this code.