mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-23 10:23:27 +02:00
Merge #19295: refactor: Use AbortError in FatalError
fa02b473132932c200be1750d1a5b1de14ea2383 refactor: Use AbortError in FatalError (MarcoFalke) Pull request description: `FatalError` has been copied from `AbortNode`, so the two should use the same style to avoid confusion. Follow-up to #18927 ACKs for top commit: hebasto: ACK fa02b473132932c200be1750d1a5b1de14ea2383, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: 2cf6d18a6ffb5c2e5cf54f0a072a7cef6dc7e924152b2fee44e6ff2c6c53bad962afd364eda30d8a73883d656429ea68391090e6a27057e69eaefd7c4dad0a33
This commit is contained in:
commit
39bd9ddb87
@ -17,15 +17,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<typename... Args>
|
||||
template <typename... Args>
|
||||
static void FatalError(const char* fmt, const Args&... args)
|
||||
{
|
||||
std::string strMessage = tfm::format(fmt, args...);
|
||||
SetMiscWarning(Untranslated(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();
|
||||
}
|
||||
|
||||
|
@ -122,6 +122,7 @@ void InitWarning(const bilingual_str& str);
|
||||
|
||||
/** Show error message **/
|
||||
bool InitError(const bilingual_str& str);
|
||||
constexpr auto AbortError = InitError;
|
||||
|
||||
extern CClientUIInterface uiInterface;
|
||||
|
||||
|
@ -1662,8 +1662,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())
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user