You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Replace init retry for loop with if statement
The for loop has been a long standing source of confusion and bugs, both
because its purpose is not clearly documented and because the body of
the for loop contains a lot of logic.
Co-Authored-By: Ryan Ofsky <[email protected]>
LogError("Internal error: failed to reset shutdown signal.\n");
1658
+
}
1659
+
std::tie(status, error) = InitAndLoadChainstate(
1640
1660
node,
1641
1661
do_reindex,
1642
1662
do_reindex_chainstate,
1643
1663
cache_sizes,
1644
1664
args);
1645
-
1646
-
if (status == node::ChainstateLoadStatus::FAILURE_FATAL || status == node::ChainstateLoadStatus::FAILURE_INCOMPATIBLE_DB || status == node::ChainstateLoadStatus::FAILURE_INSUFFICIENT_DBCACHE) {
1647
-
returnInitError(error);
1648
-
}
1649
-
1650
-
if (status == ChainstateLoadStatus::SUCCESS) {
1651
-
fLoaded = true;
1652
-
}
1653
-
1654
-
if (!fLoaded && !ShutdownRequested(node)) {
1655
-
// first suggest a reindex
1656
-
if (!do_reindex) {
1657
-
boolfRet = uiInterface.ThreadSafeQuestion(
1658
-
error + Untranslated(".\n\n") + _("Do you want to rebuild the block database now?"),
1659
-
error.original + ".\nPlease restart with -reindex or -reindex-chainstate to recover.",
0 commit comments