Bitcoin Core 28.99.0
P2P Digital Currency
|
#include <kernel_notifications.h>
Public Member Functions | |
KernelNotifications (const std::function< bool()> &shutdown_request, std::atomic< int > &exit_status, node::Warnings &warnings) | |
kernel::InterruptResult | blockTip (SynchronizationState state, CBlockIndex &index) override EXCLUSIVE_LOCKS_REQUIRED(!m_tip_block_mutex) |
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... | |
std::condition_variable m_tip_block_cv | GUARDED_BY (m_tip_block_mutex) |
uint256 m_tip_block | GUARDED_BY (m_tip_block_mutex) |
The block for which the last blockTip notification was received. More... | |
Public Member Functions inherited from kernel::Notifications | |
virtual | ~Notifications ()=default |
virtual InterruptResult | blockTip (SynchronizationState state, CBlockIndex &index) |
virtual void | headerTip (SynchronizationState state, int64_t height, int64_t timestamp, bool presync) |
virtual void | progress (const bilingual_str &title, int progress_percent, bool resume_possible) |
virtual void | warningSet (Warning id, const bilingual_str &message) |
virtual void | warningUnset (Warning id) |
virtual void | flushError (const bilingual_str &message) |
The flush error notification is sent to notify the user that an error occurred while flushing block data to disk. More... | |
virtual void | fatalError (const bilingual_str &message) |
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 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... | |
Mutex | m_tip_block_mutex |
Private Attributes | |
const std::function< bool()> & | m_shutdown_request |
std::atomic< int > & | m_exit_status |
node::Warnings & | m_warnings |
Definition at line 32 of file kernel_notifications.h.
|
inline |
Definition at line 35 of file kernel_notifications.h.
|
overridevirtual |
Reimplemented from kernel::Notifications.
Definition at line 51 of file kernel_notifications.cpp.
|
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 96 of file kernel_notifications.cpp.
|
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 91 of file kernel_notifications.cpp.
std::condition_variable m_tip_block_cv node::KernelNotifications::GUARDED_BY | ( | m_tip_block_mutex | ) |
|
inline |
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.
Definition at line 62 of file kernel_notifications.h.
|
overridevirtual |
Reimplemented from kernel::Notifications.
Definition at line 69 of file kernel_notifications.cpp.
|
overridevirtual |
Reimplemented from kernel::Notifications.
Definition at line 74 of file kernel_notifications.cpp.
|
overridevirtual |
Reimplemented from kernel::Notifications.
Definition at line 79 of file kernel_notifications.cpp.
|
overridevirtual |
Reimplemented from kernel::Notifications.
Definition at line 86 of file kernel_notifications.cpp.
|
private |
Definition at line 66 of file kernel_notifications.h.
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 55 of file kernel_notifications.h.
|
private |
Definition at line 65 of file kernel_notifications.h.
int node::KernelNotifications::m_stop_at_height {DEFAULT_STOPATHEIGHT} |
Block height after which blockTip notification will return Interrupted{}, if >0.
Definition at line 53 of file kernel_notifications.h.
Mutex node::KernelNotifications::m_tip_block_mutex |
Definition at line 57 of file kernel_notifications.h.
|
private |
Definition at line 67 of file kernel_notifications.h.