node::KernelNotifications

Kernel notification handler that tracks chain state for code above the validation layer.

Synopsis

Declared in <node/kernel_notifications.h>

class KernelNotifications
    : public kernel::Notifications

Base Classes

NameDescription
kernel::NotificationsA base class defining functions for notifying about certain kernel events.

Member Functions

NameDescription
KernelNotifications [constructor]Construct the notification handler.
TipBlock The block for which the last blockTip notification was received. It's first set when the tip is connected during node initialization. Might be unset during an early shutdown.
blockTip [virtual]Handle a new chain tip being connected.
fatalError [virtual]Handle a fatal, unrecoverable error, requesting shutdown unless disabled.
flushError [virtual]Handle a non-fatal error while flushing state to disk.
headerTip [virtual]Handle the best header advancing during headers synchronization.
progress [virtual]Report progress of a long-running operation to the UI.
setChainstateLoaded Record whether the chainstate has finished loading.
warningSet warningSet overloads
warningUnset warningUnset overloads

Data Members

NameDescription
m_shutdown_on_fatal_error Useful for tests, can be set to false to avoid shutdown on fatal error.
m_state Kernel state guarded by m_tip_block_mutex.
m_stop_at_height Block height after which blockTip notification will return Interrupted{}, if >0.
m_tip_block_cv Signaled when the tip-block state changes.
m_tip_block_mutex Guards the tip-block state and its condition variable.

Non-Member Functions

NameDescription
InterruptWaitInterrupt a blocking wait call.
::FatalErrorReport an unrecoverable error, flag the validation state as failed, and notify the node to shut down.