refactor: move RewindBlockIndex to CChainState

This is in preparation for multiple chainstate initialization in init.
This commit is contained in:
James O'Beirne
2019-12-12 10:28:14 -05:00
committed by James O'Beirne
parent 89cdf4d569
commit 5b690f0aae
3 changed files with 9 additions and 23 deletions

View File

@@ -1614,7 +1614,7 @@ bool AppInitMain(NodeContext& node)
// It both disconnects blocks based on ::ChainActive(), and drops block data in
// BlockIndex() based on lack of available witness data.
uiInterface.InitMessage(_("Rewinding blocks...").translated);
if (!RewindBlockIndex(chainparams)) {
if (!::ChainstateActive().RewindBlockIndex(chainparams)) {
strLoadError = _("Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain").translated;
break;
}