mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
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.)
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user