mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Get rid of shutdown.cpp/shutdown.h, use SignalInterrupt directly
This change is mostly a refectoring that removes some code and gets rid of an unnecessary layer of indirection after #27861 But it is not a pure refactoring since StartShutdown, AbortShutdown, and WaitForShutdown functions used to abort on failure, and the replacement code logs or returns errors instead.
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
#include <node/context.h>
|
||||
#include <node/interface_ui.h>
|
||||
#include <noui.h>
|
||||
#include <shutdown.h>
|
||||
#include <util/check.h>
|
||||
#include <util/exception.h>
|
||||
#include <util/strencodings.h>
|
||||
@@ -185,7 +184,6 @@ static bool AppInit(NodeContext& node)
|
||||
}
|
||||
|
||||
node.kernel = std::make_unique<kernel::Context>();
|
||||
node.shutdown = &node.kernel->interrupt; // TEMPORARY: will go away when kernel->interrupt member is removed
|
||||
if (!AppInitSanityChecks(*node.kernel))
|
||||
{
|
||||
// InitError will have been called with detailed error, which ends up on console
|
||||
@@ -273,9 +271,7 @@ MAIN_FUNCTION
|
||||
if (ProcessInitCommands(args)) return EXIT_SUCCESS;
|
||||
|
||||
// Start application
|
||||
if (AppInit(node)) {
|
||||
WaitForShutdown();
|
||||
} else {
|
||||
if (!AppInit(node) || !Assert(node.shutdown)->wait()) {
|
||||
node.exit_status = EXIT_FAILURE;
|
||||
}
|
||||
Interrupt(node);
|
||||
|
||||
Reference in New Issue
Block a user