mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
refactor: Remove calls to StartShutdown from KernelNotifications
Use SignalInterrupt object instead. There is a slight change in behavior here because the previous StartShutdown code used to abort on failure and the new code logs errors instead.
This commit is contained in:
parent
6824eecaf1
commit
feeb7b816a
9 changed files with 29 additions and 17 deletions
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <logging.h>
|
||||
#include <node/interface_ui.h>
|
||||
#include <shutdown.h>
|
||||
#include <util/signalinterrupt.h>
|
||||
#include <util/translation.h>
|
||||
#include <warnings.h>
|
||||
|
||||
|
|
@ -16,12 +16,14 @@
|
|||
|
||||
namespace node {
|
||||
|
||||
void AbortNode(std::atomic<int>& exit_status, const std::string& debug_message, const bilingual_str& user_message, bool shutdown)
|
||||
void AbortNode(util::SignalInterrupt* shutdown, std::atomic<int>& exit_status, const std::string& debug_message, const bilingual_str& user_message)
|
||||
{
|
||||
SetMiscWarning(Untranslated(debug_message));
|
||||
LogPrintf("*** %s\n", debug_message);
|
||||
InitError(user_message.empty() ? _("A fatal internal error occurred, see debug.log for details") : user_message);
|
||||
exit_status.store(EXIT_FAILURE);
|
||||
if (shutdown) StartShutdown();
|
||||
if (shutdown && !(*shutdown)()) {
|
||||
LogPrintf("Error: failed to send shutdown signal\n");
|
||||
};
|
||||
}
|
||||
} // namespace node
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue