diff options
author | TheCharlatan <seb.kung@gmail.com> | 2023-05-09 11:15:46 +0200 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-06-28 09:52:33 +0200 |
commit | 6eb33bd0c21b3e075fbab596351cacafdc947472 (patch) | |
tree | 70c9082689cd178c864faa39bec9b02ea1ac028b /src/shutdown.cpp | |
parent | 7320db96f8d2aeff0bc5dc67d8b7b37f5f808990 (diff) |
kernel: Add fatalError method to notifications
FatalError replaces what previously was the AbortNode function in
shutdown.cpp.
This commit is part of the libbitcoinkernel project and further removes
the shutdown's and, more generally, the kernel library's dependency on
interface_ui with a kernel notification method. By removing interface_ui
from the kernel library, its dependency on boost is reduced to just
boost::multi_index. At the same time it also takes a step towards
de-globalising the interrupt infrastructure.
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Co-authored-by: TheCharlatan <seb.kung@gmail.com>
Diffstat (limited to 'src/shutdown.cpp')
-rw-r--r-- | src/shutdown.cpp | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/shutdown.cpp b/src/shutdown.cpp index 185cad5baf..fc18ccd207 100644 --- a/src/shutdown.cpp +++ b/src/shutdown.cpp @@ -5,39 +5,13 @@ #include <shutdown.h> -#if defined(HAVE_CONFIG_H) -#include <config/bitcoin-config.h> -#endif - #include <kernel/context.h> #include <logging.h> -#include <node/interface_ui.h> #include <util/check.h> #include <util/signalinterrupt.h> -#include <warnings.h> - -#include <atomic> -#include <cassert> - -static std::atomic<int>* g_exit_status{nullptr}; -bool AbortNode(const std::string& strMessage, bilingual_str user_message) -{ - SetMiscWarning(Untranslated(strMessage)); - LogPrintf("*** %s\n", strMessage); - if (user_message.empty()) { - user_message = _("A fatal internal error occurred, see debug.log for details"); - } - InitError(user_message); - Assert(g_exit_status)->store(EXIT_FAILURE); - StartShutdown(); - return false; -} - -void InitShutdownState(std::atomic<int>& exit_status) -{ - g_exit_status = &exit_status; -} +#include <assert.h> +#include <system_error> void StartShutdown() { |