aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/init.cpp2
-rw-r--r--src/node/chainstate.cpp2
-rw-r--r--src/node/chainstate.h3
3 files changed, 4 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 38e1dbb4a2..234e338640 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1530,7 +1530,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
}
}
- if (status == node::ChainstateLoadStatus::FAILURE_INCOMPATIBLE_DB || status == node::ChainstateLoadStatus::FAILURE_INSUFFICIENT_DBCACHE) {
+ if (status == node::ChainstateLoadStatus::FAILURE_FATAL || status == node::ChainstateLoadStatus::FAILURE_INCOMPATIBLE_DB || status == node::ChainstateLoadStatus::FAILURE_INSUFFICIENT_DBCACHE) {
return InitError(error);
}
diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp
index 8f997b0594..3900d2e620 100644
--- a/src/node/chainstate.cpp
+++ b/src/node/chainstate.cpp
@@ -207,7 +207,7 @@ ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSize
} else if (snapshot_completion == SnapshotCompletionResult::SUCCESS) {
LogPrintf("[snapshot] cleaning up unneeded background chainstate, then reinitializing\n");
if (!chainman.ValidatedSnapshotCleanup()) {
- AbortNode("Background chainstate cleanup failed unexpectedly.");
+ return {ChainstateLoadStatus::FAILURE_FATAL, Untranslated("Background chainstate cleanup failed unexpectedly.")};
}
// Because ValidatedSnapshotCleanup() has torn down chainstates with
diff --git a/src/node/chainstate.h b/src/node/chainstate.h
index 77240cafe9..2e35035c28 100644
--- a/src/node/chainstate.h
+++ b/src/node/chainstate.h
@@ -42,7 +42,8 @@ struct ChainstateLoadOptions {
//! and exit cleanly in the interrupted case.
enum class ChainstateLoadStatus {
SUCCESS,
- FAILURE,
+ FAILURE, //!< Generic failure which reindexing may fix
+ FAILURE_FATAL, //!< Fatal error which should not prompt to reindex
FAILURE_INCOMPATIBLE_DB,
FAILURE_INSUFFICIENT_DBCACHE,
INTERRUPTED,