Bitcoin Core
32.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
node
abort.cpp
Go to the documentation of this file.
1
// Copyright (c) 2023-present 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/interface_ui.h
>
9
#include <
node/warnings.h
>
10
#include <
util/fs.h
>
11
#include <
util/signalinterrupt.h
>
12
#include <
util/translation.h
>
13
14
#include <atomic>
15
#include <cstdlib>
16
17
namespace
node
{
18
19
void
AbortNode
(
const
std::function<
bool
()>& shutdown_request, std::atomic<int>&
exit_status
,
const
bilingual_str
& message,
node::Warnings
* warnings)
20
{
21
if
(warnings) warnings->
Set
(
Warning::FATAL_INTERNAL_ERROR
, message);
22
InitError
(
strprintf
(
_
(
"A fatal internal error occurred, see %s for details: %s"
), fs::PathToString(
LogInstance
().m_file_path.filename()), message));
23
exit_status
.store(EXIT_FAILURE);
24
if
(shutdown_request && !shutdown_request()) {
25
LogError
(
"Failed to send shutdown signal\n"
);
26
};
27
}
28
}
// namespace node
abort.h
exit_status
int exit_status
Definition
bitcoin-wallet.cpp:100
node::Warnings
Manages warning messages within a node.
Definition
warnings.h:40
node::Warnings::Set
bool Set(warning_type id, bilingual_str message) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Set a warning message.
Definition
warnings.cpp:29
fs.h
InitError
bool InitError(const bilingual_str &str)
Show error message.
Definition
interface_ui.cpp:15
interface_ui.h
LogError
#define LogError(...)
Definition
log.h:127
LogInstance
BCLog::Logger & LogInstance()
Definition
logging.cpp:26
node
Definition
messages.h:21
node::AbortNode
void AbortNode(const std::function< bool()> &shutdown_request, std::atomic< int > &exit_status, const bilingual_str &message, node::Warnings *warnings)
Definition
abort.cpp:19
node::Warning::FATAL_INTERNAL_ERROR
@ FATAL_INTERNAL_ERROR
Definition
warnings.h:26
signalinterrupt.h
bilingual_str
Bilingual messages:
Definition
translation.h:24
strprintf
#define strprintf
Format arguments and return the string or write to given std::ostream (see tinyformat::format doc for...
Definition
tinyformat.h:1172
translation.h
_
consteval auto _(util::TranslatedLiteral str)
Definition
translation.h:79
warnings.h
Generated on
for Bitcoin Core by
1.18.0