diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-06-08 18:35:00 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-06-08 18:35:00 +0300 |
commit | 5527be06277647dffe7cda587c4bbfbec2a5c8ca (patch) | |
tree | 101219968bd950db2e001b68a0201438185c9773 /src/validation.cpp | |
parent | d924f2a596c8f37deb2dd94069c578244823c31f (diff) |
refactor: Add AbortError alias
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 51e51ecb67..46b96996a7 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1654,16 +1654,17 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex* pindex) return true; } +constexpr auto AbortError = InitError; + /** Abort with a message */ -static bool AbortNode(const std::string& strMessage, const bilingual_str& userMessage = bilingual_str()) +static bool AbortNode(const std::string& strMessage, bilingual_str user_message = bilingual_str()) { SetMiscWarning(strMessage); LogPrintf("*** %s\n", strMessage); - if (!userMessage.empty()) { - uiInterface.ThreadSafeMessageBox(userMessage, "", CClientUIInterface::MSG_ERROR); - } else { - uiInterface.ThreadSafeMessageBox(_("A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR); + if (user_message.empty()) { + user_message = _("A fatal internal error occurred, see debug.log for details"); } + AbortError(user_message); StartShutdown(); return false; } |