aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2023-07-07 12:53:31 -0400
committerRyan Ofsky <ryan@ofsky.org>2023-07-11 12:30:56 -0400
commit31eca93a9eb8e54f856d3f558aa3c831ef181d37 (patch)
treed23d9868e0270684e4dc91dfb3ea7535d374b14b /src/init.cpp
parent99b3af78bd5209b3ed0b192d0b18ee2c49079d1d (diff)
downloadbitcoin-31eca93a9eb8e54f856d3f558aa3c831ef181d37.tar.xz
kernel: Remove StartShutdown calls from validation code
This change drops the last kernel dependency on shutdown.cpp. It also adds new hooks for libbitcoinkernel applications to be able to interrupt kernel operations when the chain tip changes. This is a refactoring that does not affect behavior. (Looking at the code it can appear like the new break statement in the ActivateBestChain function is a change in behavior, but actually the previous StartShutdown call was indirectly triggering a break before, because it was causing m_chainman.m_interrupt to be true. The new code just makes the break more obvious.)
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 2f4eec060b..f726fe54ca 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -123,6 +123,7 @@ using node::CacheSizes;
using node::CalculateCacheSizes;
using node::DEFAULT_PERSIST_MEMPOOL;
using node::DEFAULT_PRINTPRIORITY;
+using node::DEFAULT_STOPATHEIGHT;
using node::fReindex;
using node::KernelNotifications;
using node::LoadChainstate;
@@ -1408,6 +1409,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
// ********************************************************* Step 7: load block chain
node.notifications = std::make_unique<KernelNotifications>(node.exit_status);
+ ReadNotificationArgs(args, *node.notifications);
fReindex = args.GetBoolArg("-reindex", false);
bool fReindexChainState = args.GetBoolArg("-reindex-chainstate", false);
ChainstateManager::Options chainman_opts{