Skip to content

Commit 5527be0

Browse files
committed
refactor: Add AbortError alias
1 parent d924f2a commit 5527be0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/validation.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,16 +1654,17 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex* pindex)
16541654
return true;
16551655
}
16561656

1657+
constexpr auto AbortError = InitError;
1658+
16571659
/** Abort with a message */
1658-
static bool AbortNode(const std::string& strMessage, const bilingual_str& userMessage = bilingual_str())
1660+
static bool AbortNode(const std::string& strMessage, bilingual_str user_message = bilingual_str())
16591661
{
16601662
SetMiscWarning(strMessage);
16611663
LogPrintf("*** %s\n", strMessage);
1662-
if (!userMessage.empty()) {
1663-
uiInterface.ThreadSafeMessageBox(userMessage, "", CClientUIInterface::MSG_ERROR);
1664-
} else {
1665-
uiInterface.ThreadSafeMessageBox(_("A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR);
1664+
if (user_message.empty()) {
1665+
user_message = _("A fatal internal error occurred, see debug.log for details");
16661666
}
1667+
AbortError(user_message);
16671668
StartShutdown();
16681669
return false;
16691670
}

0 commit comments

Comments
 (0)