mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 11:44:14 +01:00
refactor: Add AbortError alias
This commit is contained in:
@@ -1654,16 +1654,17 @@ 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, const bilingual_str& userMessage = bilingual_str())
|
static bool AbortNode(const std::string& strMessage, bilingual_str user_message = bilingual_str())
|
||||||
{
|
{
|
||||||
SetMiscWarning(strMessage);
|
SetMiscWarning(strMessage);
|
||||||
LogPrintf("*** %s\n", strMessage);
|
LogPrintf("*** %s\n", strMessage);
|
||||||
if (!userMessage.empty()) {
|
if (user_message.empty()) {
|
||||||
uiInterface.ThreadSafeMessageBox(userMessage, "", CClientUIInterface::MSG_ERROR);
|
user_message = _("A fatal internal error occurred, see debug.log for details");
|
||||||
} else {
|
|
||||||
uiInterface.ThreadSafeMessageBox(_("A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR);
|
|
||||||
}
|
}
|
||||||
|
AbortError(user_message);
|
||||||
StartShutdown();
|
StartShutdown();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user