This is part of the assumeutxo project:
Parent PR: #15606 Issue: #15605 Specification: https://github.com/jamesob/assumeutxo-docs/tree/2019-04-proposal/proposal
This changeset starts moving functionality intimately related to CChainState into methods. Parameterizing these functions by a particular CChainState is necessary for the use of multiple chainstates simultaneously (e.g. for asynchronous background validation).
In this change, we
- make the CChainState interface public - since other units will start to invoke its methods directly,
- introduce
::ChainstateActive()
, the CChainState equivalent for::ChainActive()
, - and move
IsInitialBlockDownload()
andFlushStateToDisk()
into methods on CChainState.
Independent of assumeutxo, these changes better encapsulate chainstate behavior and allow easier use from a testing context.
There are more methods that we’ll move in the future, but they require other substantial changes (i.e. moving ownership of the CCoinsView*
hierarchy into CChainState) so we’ll save them for future PRs.
The first move-only commit is most easily reviewed with git diff ... --color-moved=dimmed_zebra
.