aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-chainstate.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/bitcoin-chainstate.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/bitcoin-chainstate.cpp')
-rw-r--r--src/bitcoin-chainstate.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp
index 45fd239e20..580a6badd6 100644
--- a/src/bitcoin-chainstate.cpp
+++ b/src/bitcoin-chainstate.cpp
@@ -81,9 +81,10 @@ int main(int argc, char* argv[])
class KernelNotifications : public kernel::Notifications
{
public:
- void blockTip(SynchronizationState, CBlockIndex&) override
+ kernel::InterruptResult blockTip(SynchronizationState, CBlockIndex&) override
{
std::cout << "Block tip changed" << std::endl;
+ return {};
}
void headerTip(SynchronizationState, int64_t height, int64_t timestamp, bool presync) override
{