refactor: Use AbortError in FatalError

This is needed for consistency with AbortNode
pull/764/head
MarcoFalke 4 years ago
parent 4b30c41b4e
commit fa02b47313
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

@ -17,15 +17,13 @@ constexpr char DB_BEST_BLOCK = 'B';
constexpr int64_t SYNC_LOG_INTERVAL = 30; // seconds constexpr int64_t SYNC_LOG_INTERVAL = 30; // seconds
constexpr int64_t SYNC_LOCATOR_WRITE_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) static void FatalError(const char* fmt, const Args&... args)
{ {
std::string strMessage = tfm::format(fmt, args...); std::string strMessage = tfm::format(fmt, args...);
SetMiscWarning(Untranslated(strMessage)); SetMiscWarning(Untranslated(strMessage));
LogPrintf("*** %s\n", strMessage); LogPrintf("*** %s\n", strMessage);
uiInterface.ThreadSafeMessageBox( AbortError(_("A fatal internal error occurred, see debug.log for details"));
Untranslated("Error: A fatal internal error occurred, see debug.log for details"),
"", CClientUIInterface::MSG_ERROR);
StartShutdown(); StartShutdown();
} }

@ -122,6 +122,7 @@ void InitWarning(const bilingual_str& str);
/** Show error message **/ /** Show error message **/
bool InitError(const bilingual_str& str); bool InitError(const bilingual_str& str);
constexpr auto AbortError = InitError;
extern CClientUIInterface uiInterface; extern CClientUIInterface uiInterface;

@ -1662,8 +1662,6 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex* pindex)
return true; return true;
} }
constexpr auto AbortError = InitError;
/** Abort with a message */ /** Abort with a message */
static bool AbortNode(const std::string& strMessage, bilingual_str user_message = bilingual_str()) static bool AbortNode(const std::string& strMessage, bilingual_str user_message = bilingual_str())
{ {

Loading…
Cancel
Save