[#node-KernelNotifications] = xref:node.adoc[node]::KernelNotifications :relfileprefix: ../ :mrdocs: Kernel notification handler that tracks chain state for code above the validation layer. == Synopsis Declared in `<node/kernel_notifications.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class KernelNotifications : public xref:kernel/Notifications.adoc[kernel::Notifications] ---- == Base Classes [cols="1,4"] |=== | Name| Description | `xref:kernel/Notifications.adoc[kernel::Notifications]` | A base class defining functions for notifying about certain kernel events. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:node/KernelNotifications/2constructor.adoc[`KernelNotifications`] [.small]#[constructor]# | Construct the notification handler. | xref:node/KernelNotifications/TipBlock.adoc[`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. | xref:node/KernelNotifications/blockTip.adoc[`blockTip`] [.small]#[virtual]# | Handle a new chain tip being connected. | xref:node/KernelNotifications/fatalError.adoc[`fatalError`] [.small]#[virtual]# | Handle a fatal, unrecoverable error, requesting shutdown unless disabled. | xref:node/KernelNotifications/flushError.adoc[`flushError`] [.small]#[virtual]# | Handle a non‐fatal error while flushing state to disk. | xref:node/KernelNotifications/headerTip.adoc[`headerTip`] [.small]#[virtual]# | Handle the best header advancing during headers synchronization. | xref:node/KernelNotifications/progress.adoc[`progress`] [.small]#[virtual]# | Report progress of a long‐running operation to the UI. | xref:node/KernelNotifications/setChainstateLoaded.adoc[`setChainstateLoaded`] | Record whether the chainstate has finished loading. | xref:node/KernelNotifications/warningSet-0e.adoc[`warningSet`] | `warningSet` overloads | xref:node/KernelNotifications/warningUnset-04.adoc[`warningUnset`] | `warningUnset` overloads |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:node/KernelNotifications/m_shutdown_on_fatal_error.adoc[`m_shutdown_on_fatal_error`] | Useful for tests, can be set to false to avoid shutdown on fatal error. | xref:node/KernelNotifications/m_state.adoc[`m_state`] | Kernel state guarded by m_tip_block_mutex. | xref:node/KernelNotifications/m_stop_at_height.adoc[`m_stop_at_height`] | Block height after which blockTip notification will return Interrupted{}, if >0. | xref:node/KernelNotifications/m_tip_block_cv.adoc[`m_tip_block_cv`] | Signaled when the tip‐block state changes. | xref:node/KernelNotifications/m_tip_block_mutex.adoc[`m_tip_block_mutex`] | Guards the tip‐block state and its condition variable. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:node/InterruptWait.adoc[`InterruptWait`] | Interrupt a blocking wait call. | xref:FatalError.adoc[`::FatalError`] | Report an unrecoverable error, flag the validation state as failed, and notify the node to shut down. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#