inline chain stats updating
Summary:
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 now with assumeutxo developments, the code branches in the code loading blocks from disk and code processing blocks from the network have diverged, we no longer need to maintain a nChainSize stat (D17878), and the refactored solution has additional complexity.
It 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, D17872 and reapply D17873 accordingly.
The 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.
Test Plan: On D17931, with a Debug build, run the functional test feature_assumeutxo.py
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D17938