refactor: Add Chainstate m_assumeutxo and m_target_utxohash members

Get rid of m_disabled/IsUsable members. Instead of marking chains disabled for
different reasons, store chainstate assumeutxo status explicitly and use that
information to determine how chains should be treated.
This commit is contained in:
Ryan Ofsky
2025-04-16 11:53:44 -04:00
parent 6082c84713
commit 9fe927b6d6
3 changed files with 54 additions and 66 deletions

View File

@@ -97,14 +97,13 @@ sequentially.
### Background chainstate hits snapshot base block
Once the tip of the background chainstate hits the base block of the snapshot
chainstate, we stop use of the background chainstate by setting `m_disabled`, in
`MaybeCompleteSnapshotValidation()`, which is checked in `ActivateBestChain()`). We hash the
chainstate, we hash the
background chainstate's UTXO set contents and ensure it matches the compiled value in
`CMainParams::m_assumeutxo_data`.
| | |
| ---------- | ----------- |
| number of chainstates | 2 (ibd has `m_disabled=true`) |
| number of chainstates | 2 |
| active chainstate | snapshot |
The background chainstate data lingers on disk until the program is restarted.