From 7adf0c47570bb0ff8a3a7f541180bbd32ea4d6b4 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Date: Tue, 16 Jun 2020 11:02:46 -0400 Subject: [PATCH] merge bitcoin#19295: Use AbortError in FatalError --- src/index/base.cpp | 6 ++---- src/ui_interface.h | 1 + src/validation.cpp | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/index/base.cpp b/src/index/base.cpp index 8ff841082b..6d1ed6ec37 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -16,15 +16,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 +template static void FatalError(const char* fmt, const Args&... args) { std::string strMessage = tfm::format(fmt, args...); SetMiscWarning(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 b3fec1984b..b03df680ee 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -139,6 +139,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 105e1cc8a1..32a628e665 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1573,8 +1573,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()) {