aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-06-16 11:02:46 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-06-16 10:51:50 -0400
commitfa02b473132932c200be1750d1a5b1de14ea2383 (patch)
tree8e6afbd86be3614afaf3cfc4f67f5c63b2558967 /src
parent4b30c41b4ebf2eb70d8a3cd99cf4d05d405eec81 (diff)
refactor: Use AbortError in FatalError
This is needed for consistency with AbortNode
Diffstat (limited to 'src')
-rw-r--r--src/index/base.cpp6
-rw-r--r--src/ui_interface.h1
-rw-r--r--src/validation.cpp2
3 files changed, 3 insertions, 6 deletions
diff --git a/src/index/base.cpp b/src/index/base.cpp
index 1d09f2e577..a93b67395d 100644
--- a/src/index/base.cpp
+++ b/src/index/base.cpp
@@ -17,15 +17,13 @@ constexpr char DB_BEST_BLOCK = 'B';
constexpr int64_t SYNC_LOG_INTERVAL = 30; // seconds
constexpr int64_t SYNC_LOCATOR_WRITE_INTERVAL = 30; // seconds
-template<typename... Args>
+template <typename... Args>
static void FatalError(const char* fmt, const Args&... args)
{
std::string strMessage = tfm::format(fmt, args...);
SetMiscWarning(Untranslated(strMessage));
LogPrintf("*** %s\n", strMessage);
- uiInterface.ThreadSafeMessageBox(
- Untranslated("Error: A fatal internal error occurred, see debug.log for details"),
- "", CClientUIInterface::MSG_ERROR);
+ AbortError(_("A fatal internal error occurred, see debug.log for details"));
StartShutdown();
}
diff --git a/src/ui_interface.h b/src/ui_interface.h
index 9f70d7b35c..356d30eaf6 100644
--- a/src/ui_interface.h
+++ b/src/ui_interface.h
@@ -122,6 +122,7 @@ void InitWarning(const bilingual_str& str);
/** Show error message **/
bool InitError(const bilingual_str& str);
+constexpr auto AbortError = InitError;
extern CClientUIInterface uiInterface;
diff --git a/src/validation.cpp b/src/validation.cpp
index 49c0142be2..8bb03fdb97 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1662,8 +1662,6 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex* pindex)
return true;
}
-constexpr auto AbortError = InitError;
-
/** Abort with a message */
static bool AbortNode(const std::string& strMessage, bilingual_str user_message = bilingual_str())
{