Skip to content

Commit fa02b47

Browse files
author
MarcoFalke
committed
refactor: Use AbortError in FatalError
This is needed for consistency with AbortNode
1 parent 4b30c41 commit fa02b47

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/index/base.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@ constexpr char DB_BEST_BLOCK = 'B';
1717
constexpr int64_t SYNC_LOG_INTERVAL = 30; // seconds
1818
constexpr int64_t SYNC_LOCATOR_WRITE_INTERVAL = 30; // seconds
1919

20-
template<typename... Args>
20+
template <typename... Args>
2121
static void FatalError(const char* fmt, const Args&... args)
2222
{
2323
std::string strMessage = tfm::format(fmt, args...);
2424
SetMiscWarning(Untranslated(strMessage));
2525
LogPrintf("*** %s\n", strMessage);
26-
uiInterface.ThreadSafeMessageBox(
27-
Untranslated("Error: A fatal internal error occurred, see debug.log for details"),
28-
"", CClientUIInterface::MSG_ERROR);
26+
AbortError(_("A fatal internal error occurred, see debug.log for details"));
2927
StartShutdown();
3028
}
3129

src/ui_interface.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ void InitWarning(const bilingual_str& str);
122122

123123
/** Show error message **/
124124
bool InitError(const bilingual_str& str);
125+
constexpr auto AbortError = InitError;
125126

126127
extern CClientUIInterface uiInterface;
127128

src/validation.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,8 +1662,6 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex* pindex)
16621662
return true;
16631663
}
16641664

1665-
constexpr auto AbortError = InitError;
1666-
16671665
/** Abort with a message */
16681666
static bool AbortNode(const std::string& strMessage, bilingual_str user_message = bilingual_str())
16691667
{

0 commit comments

Comments
 (0)