diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-04-02 20:49:01 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-04-04 18:08:36 +0200 |
commit | fa91b2b2b3447a3645e7958c7dc4e1946a69cb9c (patch) | |
tree | 58715475a162cc790608a10b3c016ba015201094 /src/shutdown.cpp | |
parent | fa413f07a14744e7d7f7746e861aabd9cf938f61 (diff) |
move-only: Move AbortNode to shutdown
Can be reviewed with the git option
--color-moved=dimmed-zebra
Diffstat (limited to 'src/shutdown.cpp')
-rw-r--r-- | src/shutdown.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shutdown.cpp b/src/shutdown.cpp index 2fc195e2d1..35faf3c412 100644 --- a/src/shutdown.cpp +++ b/src/shutdown.cpp @@ -6,7 +6,9 @@ #include <shutdown.h> #include <logging.h> +#include <node/ui_interface.h> #include <util/tokenpipe.h> +#include <warnings.h> #include <config/bitcoin-config.h> @@ -16,6 +18,18 @@ #include <condition_variable> #endif +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"); + } + AbortError(user_message); + StartShutdown(); + return false; +} + static std::atomic<bool> fRequestShutdown(false); #ifdef WIN32 /** On windows it is possible to simply use a condition variable. */ |