[#node-KernelNotifications]
= xref:node.adoc[node]::KernelNotifications
:relfileprefix: ../
:mrdocs:

Kernel notification handler that tracks chain state for code above the validation layer&period;

== Synopsis

Declared in `&lt;node&sol;kernel&lowbar;notifications&period;h&gt;`

[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&period;
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:node/KernelNotifications/2constructor.adoc[`KernelNotifications`]         [.small]#[constructor]#
| Construct the notification handler&period;
| xref:node/KernelNotifications/TipBlock.adoc[`TipBlock`] 
| The block for which the last blockTip notification was received&period; It&apos;s first set when the tip is connected during node initialization&period; Might be unset during an early shutdown&period;
| xref:node/KernelNotifications/blockTip.adoc[`blockTip`]  [.small]#[virtual]#
| Handle a new chain tip being connected&period;
| xref:node/KernelNotifications/fatalError.adoc[`fatalError`]  [.small]#[virtual]#
| Handle a fatal, unrecoverable error, requesting shutdown unless disabled&period;
| xref:node/KernelNotifications/flushError.adoc[`flushError`]  [.small]#[virtual]#
| Handle a non&hyphen;fatal error while flushing state to disk&period;
| xref:node/KernelNotifications/headerTip.adoc[`headerTip`]  [.small]#[virtual]#
| Handle the best header advancing during headers synchronization&period;
| xref:node/KernelNotifications/progress.adoc[`progress`]  [.small]#[virtual]#
| Report progress of a long&hyphen;running operation to the UI&period;
| xref:node/KernelNotifications/setChainstateLoaded.adoc[`setChainstateLoaded`] 
| Record whether the chainstate has finished loading&period;
| 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&lowbar;shutdown&lowbar;on&lowbar;fatal&lowbar;error`] 
| Useful for tests, can be set to false to avoid shutdown on fatal error&period;
| xref:node/KernelNotifications/m_state.adoc[`m&lowbar;state`] 
| Kernel state guarded by m&lowbar;tip&lowbar;block&lowbar;mutex&period;
| xref:node/KernelNotifications/m_stop_at_height.adoc[`m&lowbar;stop&lowbar;at&lowbar;height`] 
| Block height after which blockTip notification will return Interrupted&lcub;&rcub;, if &gt;0&period;
| xref:node/KernelNotifications/m_tip_block_cv.adoc[`m&lowbar;tip&lowbar;block&lowbar;cv`] 
| Signaled when the tip&hyphen;block state changes&period;
| xref:node/KernelNotifications/m_tip_block_mutex.adoc[`m&lowbar;tip&lowbar;block&lowbar;mutex`] 
| Guards the tip&hyphen;block state and its condition variable&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:node/InterruptWait.adoc[`InterruptWait`]
| Interrupt a blocking wait call&period;
| xref:FatalError.adoc[`&colon;&colon;FatalError`]
| Report an unrecoverable error, flag the validation state as failed, and notify the node to shut down&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
