The snapshot base has a `pprev` from the headers chain,D6308 used to be an elegant way of factoring the check for "is the block the genesis or all parents have data" and the updating of `nChainTx`. but that parent block does not have any dataBut now with assumeutxo developments, so it has `pprev.nChainTx = 0`.the code branches in the code loading blocks from disk and code processing blocks from the network have diverged, The snapshot base does have its own `nChainTx` set from the snapshot metadata, So `nTx + 0 != nChainTx` makes the `Assume` fail.we no longer need to maintain a `nChainSize` stat (D17878), This is not triggered for Core because the `Assume` is not reached whereas it is triggered for Bitcoin ABC because `UpdateChainStats` is used for two different things in our codebasse: testing and returning `pprev == nullptr || pprev->nChainTx > 0;` and setting the `nChainTx` valueand the refactored solution has additional complexity.
The easiest solution applied in this diff is to just not fail the assumption if this is the snapshot base blockIt will make reasoning about the state of the block easier to just inline the different computations where they are needed. And it will also make future backports easier by following what Core is doing.
Revert D6308, like we already do in `MaybeResetChainStats`D17872 and reapply D17873 accordingly.
Another solution, arguably simpler for long term maintenance, is to revert D6308 (dont mix the testing and updating of nChainTx) and go back to following Core's lead for this piece of codeThe only change in behavior should be that now we don't hit the `Assume(....)` assertion that used to be in `UpdateChainStats` when pindexNew is not the genesis block and some parent blocks are missing data.