Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | Private Attributes | List of all members
node::KernelNotifications Class Reference

#include <kernel_notifications.h>

Inheritance diagram for node::KernelNotifications:
[legend]
Collaboration diagram for node::KernelNotifications:
[legend]

Public Member Functions

 KernelNotifications (util::SignalInterrupt &shutdown, std::atomic< int > &exit_status, node::Warnings &warnings)
 
kernel::InterruptResult blockTip (SynchronizationState state, CBlockIndex &index) override
 
void headerTip (SynchronizationState state, int64_t height, int64_t timestamp, bool presync) override
 
void progress (const bilingual_str &title, int progress_percent, bool resume_possible) override
 
void warningSet (kernel::Warning id, const bilingual_str &message) override
 
void warningUnset (kernel::Warning id) override
 
void flushError (const bilingual_str &message) override
 The flush error notification is sent to notify the user that an error occurred while flushing block data to disk. More...
 
void fatalError (const bilingual_str &message) override
 The fatal error notification is sent to notify the user when an error occurs in kernel code that can't be recovered from. More...
 
- Public Member Functions inherited from kernel::Notifications
virtual ~Notifications ()=default
 

Public Attributes

int m_stop_at_height {DEFAULT_STOPATHEIGHT}
 Block height after which blockTip notification will return Interrupted{}, if >0. More...
 
bool m_shutdown_on_fatal_error {true}
 Useful for tests, can be set to false to avoid shutdown on fatal error. More...
 

Private Attributes

util::SignalInterruptm_shutdown
 
std::atomic< int > & m_exit_status
 
node::Warningsm_warnings
 

Detailed Description

Definition at line 31 of file kernel_notifications.h.

Constructor & Destructor Documentation

◆ KernelNotifications()

node::KernelNotifications::KernelNotifications ( util::SignalInterrupt shutdown,
std::atomic< int > &  exit_status,
node::Warnings warnings 
)
inline

Definition at line 34 of file kernel_notifications.h.

Member Function Documentation

◆ blockTip()

kernel::InterruptResult node::KernelNotifications::blockTip ( SynchronizationState  state,
CBlockIndex index 
)
overridevirtual

Reimplemented from kernel::Notifications.

Definition at line 51 of file kernel_notifications.cpp.

◆ fatalError()

void node::KernelNotifications::fatalError ( const bilingual_str message)
overridevirtual

The fatal error notification is sent to notify the user when an error occurs in kernel code that can't be recovered from.

After this notification is sent, whatever function triggered the error should also return an error code or raise an exception. Applications can choose to handle the fatal error notification by logging the error, or notifying the user, or triggering an early shutdown as a precaution against causing more errors.

Reimplemented from kernel::Notifications.

Definition at line 90 of file kernel_notifications.cpp.

Here is the call graph for this function:

◆ flushError()

void node::KernelNotifications::flushError ( const bilingual_str message)
overridevirtual

The flush error notification is sent to notify the user that an error occurred while flushing block data to disk.

Kernel code may ignore flush errors that don't affect the immediate operation it is trying to perform. Applications can choose to handle the flush error notification by logging the error, or notifying the user, or triggering an early shutdown as a precaution against causing more errors.

Reimplemented from kernel::Notifications.

Definition at line 85 of file kernel_notifications.cpp.

Here is the call graph for this function:

◆ headerTip()

void node::KernelNotifications::headerTip ( SynchronizationState  state,
int64_t  height,
int64_t  timestamp,
bool  presync 
)
overridevirtual

Reimplemented from kernel::Notifications.

Definition at line 63 of file kernel_notifications.cpp.

◆ progress()

void node::KernelNotifications::progress ( const bilingual_str title,
int  progress_percent,
bool  resume_possible 
)
overridevirtual

Reimplemented from kernel::Notifications.

Definition at line 68 of file kernel_notifications.cpp.

◆ warningSet()

void node::KernelNotifications::warningSet ( kernel::Warning  id,
const bilingual_str message 
)
overridevirtual

Reimplemented from kernel::Notifications.

Definition at line 73 of file kernel_notifications.cpp.

Here is the call graph for this function:

◆ warningUnset()

void node::KernelNotifications::warningUnset ( kernel::Warning  id)
overridevirtual

Reimplemented from kernel::Notifications.

Definition at line 80 of file kernel_notifications.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ m_exit_status

std::atomic<int>& node::KernelNotifications::m_exit_status
private

Definition at line 57 of file kernel_notifications.h.

◆ m_shutdown

util::SignalInterrupt& node::KernelNotifications::m_shutdown
private

Definition at line 56 of file kernel_notifications.h.

◆ m_shutdown_on_fatal_error

bool node::KernelNotifications::m_shutdown_on_fatal_error {true}

Useful for tests, can be set to false to avoid shutdown on fatal error.

Definition at line 54 of file kernel_notifications.h.

◆ m_stop_at_height

int node::KernelNotifications::m_stop_at_height {DEFAULT_STOPATHEIGHT}

Block height after which blockTip notification will return Interrupted{}, if >0.

Definition at line 52 of file kernel_notifications.h.

◆ m_warnings

node::Warnings& node::KernelNotifications::m_warnings
private

Definition at line 58 of file kernel_notifications.h.


The documentation for this class was generated from the following files: