Bitcoin ABC 0.32.4
P2P Digital Currency
abort.cpp
Go to the documentation of this file.
1// Copyright (c) 2023 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <node/abort.h>
6
7#include <logging.h>
8#include <node/ui_interface.h>
9#include <shutdown.h>
10#include <util/translation.h>
11#include <warnings.h>
12
13#include <atomic>
14#include <cstdlib>
15#include <string>
16
17namespace node {
18
19void AbortNode(std::atomic<int> &exit_status, const std::string &debug_message,
20 const bilingual_str &user_message, bool shutdown) {
21 SetMiscWarning(Untranslated(debug_message));
22 LogPrintf("*** %s\n", debug_message);
24 user_message.empty()
25 ? _("A fatal internal error occurred, see debug.log for details")
26 : user_message);
27 exit_status.store(EXIT_FAILURE);
28 if (shutdown) {
30 }
31}
32} // namespace node
#define LogPrintf(...)
Definition: logging.h:424
Definition: init.h:31
void AbortNode(std::atomic< int > &exit_status, const std::string &debug_message, const bilingual_str &user_message, bool shutdown)
Definition: abort.cpp:19
void StartShutdown()
Request shutdown of the application.
Definition: shutdown.cpp:16
Bilingual messages:
Definition: translation.h:17
bool empty() const
Definition: translation.h:27
bilingual_str _(const char *psz)
Translation function.
Definition: translation.h:68
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.
Definition: translation.h:36
bool InitError(const bilingual_str &str)
Show error message.
void SetMiscWarning(const bilingual_str &warning)
Definition: warnings.cpp:21