@ -1419,20 +1419,26 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
uiInterface . InitMessage ( _ ( " Loading block index… " ) . translated ) ;
uiInterface . InitMessage ( _ ( " Loading block index… " ) . translated ) ;
const int64_t load_block_index_start_time = GetTimeMillis ( ) ;
const int64_t load_block_index_start_time = GetTimeMillis ( ) ;
auto rv = LoadChainstate ( fReset ,
std : : optional < ChainstateLoadingError > rv ;
chainman ,
try {
Assert ( node . mempool . get ( ) ) ,
rv = LoadChainstate ( fReset ,
fPruneMode ,
chainman ,
chainparams ,
Assert ( node . mempool . get ( ) ) ,
fReindexChainState ,
fPruneMode ,
nBlockTreeDBCache ,
chainparams ,
nCoinDBCache ,
fReindexChainState ,
nCoinCacheUsage ,
nBlockTreeDBCache ,
[ ] ( ) {
nCoinDBCache ,
uiInterface . ThreadSafeMessageBox (
nCoinCacheUsage ,
_ ( " Error reading from database, shutting down. " ) ,
[ ] ( ) {
" " , CClientUIInterface : : MSG_ERROR ) ;
uiInterface . ThreadSafeMessageBox (
} ) ;
_ ( " Error reading from database, shutting down. " ) ,
" " , CClientUIInterface : : MSG_ERROR ) ;
} ) ;
} catch ( const std : : exception & e ) {
LogPrintf ( " %s \n " , e . what ( ) ) ;
rv = ChainstateLoadingError : : ERROR_GENERIC_BLOCKDB_OPEN_FAILED ;
}
if ( rv . has_value ( ) ) {
if ( rv . has_value ( ) ) {
switch ( rv . value ( ) ) {
switch ( rv . value ( ) ) {
case ChainstateLoadingError : : ERROR_LOADING_BLOCK_DB :
case ChainstateLoadingError : : ERROR_LOADING_BLOCK_DB :
@ -1468,13 +1474,19 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
break ;
break ;
}
}
} else {
} else {
uiInterface . InitMessage ( _ ( " Verifying blocks… " ) . translated ) ;
std : : optional < ChainstateLoadVerifyError > rv2 ;
auto rv2 = VerifyLoadedChainstate ( chainman ,
try {
fReset ,
uiInterface . InitMessage ( _ ( " Verifying blocks… " ) . translated ) ;
fReindexChainState ,
rv2 = VerifyLoadedChainstate ( chainman ,
chainparams ,
fReset ,
args . GetIntArg ( " -checkblocks " , DEFAULT_CHECKBLOCKS ) ,
fReindexChainState ,
args . GetIntArg ( " -checklevel " , DEFAULT_CHECKLEVEL ) ) ;
chainparams ,
args . GetIntArg ( " -checkblocks " , DEFAULT_CHECKBLOCKS ) ,
args . GetIntArg ( " -checklevel " , DEFAULT_CHECKLEVEL ) ) ;
} catch ( const std : : exception & e ) {
LogPrintf ( " %s \n " , e . what ( ) ) ;
rv2 = ChainstateLoadVerifyError : : ERROR_GENERIC_FAILURE ;
}
if ( rv2 . has_value ( ) ) {
if ( rv2 . has_value ( ) ) {
switch ( rv2 . value ( ) ) {
switch ( rv2 . value ( ) ) {
case ChainstateLoadVerifyError : : ERROR_BLOCK_FROM_FUTURE :
case ChainstateLoadVerifyError : : ERROR_BLOCK_FROM_FUTURE :