Page MenuHomePhabricator

don't log "Internal bug detected" for the snapshot base block
DraftPublic

Authored by PiRK on Tue, Apr 15, 15:32.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

The snapshot base has a pprev from the headers chain, but that parent block does not have any data, so it has pprev.nChainTx = 0. The snapshot base does have its own nChainTx set from the snapshot metadata, So nTx + 0 != nChainTx makes the Assume fail. 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 value.

The easiest solution applied in this diff is to just not fail the assumption if this is the snapshot base block, like we already do in MaybeResetChainStats.
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 code.

Test Plan

On D17931, with a Debug build, run the functional test feature_assumeutxo.py