5#ifndef BITCOIN_NODE_KERNEL_NOTIFICATIONS_H
6#define BITCOIN_NODE_KERNEL_NOTIFICATIONS_H
66 if (!chainstate_loaded) m_state = {};
67 m_state.chainstate_loaded = chainstate_loaded;
68 m_tip_block_cv.notify_all();
The block chain is a tree shaped structure starting with the genesis block at the root,...
A base class defining functions for notifying about certain kernel events.
int m_stop_at_height
Block height after which blockTip notification will return Interrupted{}, if >0.
const std::function< bool()> & m_shutdown_request
void headerTip(SynchronizationState state, int64_t height, int64_t timestamp, bool presync) override
std::atomic< int > & m_exit_status
void progress(const bilingual_str &title, int progress_percent, bool resume_possible) override
void warningSet(kernel::Warning id, const bilingual_str &message) override
KernelState m_state GUARDED_BY(m_tip_block_mutex)
std::condition_variable m_tip_block_cv GUARDED_BY(m_tip_block_mutex)
void setChainstateLoaded(bool chainstate_loaded) EXCLUSIVE_LOCKS_REQUIRED(!m_tip_block_mutex)
node::Warnings & m_warnings
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'...
std::optional< uint256 > TipBlock() EXCLUSIVE_LOCKS_REQUIRED(m_tip_block_mutex)
The block for which the last blockTip notification was received.
void warningUnset(kernel::Warning id) override
KernelNotifications(const std::function< bool()> &shutdown_request, std::atomic< int > &exit_status, node::Warnings &warnings)
bool m_shutdown_on_fatal_error
Useful for tests, can be set to false to avoid shutdown on fatal error.
void flushError(const bilingual_str &message) override
The flush error notification is sent to notify the user that an error occurred while flushing block d...
kernel::InterruptResult blockTip(SynchronizationState state, const CBlockIndex &index, double verification_progress) override EXCLUSIVE_LOCKS_REQUIRED(!m_tip_block_mutex)
Manages warning messages within a node.
std::variant< std::monostate, Interrupted > InterruptResult
Simple result type for functions that need to propagate an interrupt status and don't have other retu...
void ReadNotificationArgs(const ArgsManager &args, KernelNotifications ¬ifications)
static constexpr int DEFAULT_STOPATHEIGHT
State tracked by the KernelNotifications interface meant to be used by mining code,...
std::optional< uint256 > tip_block
#define EXCLUSIVE_LOCKS_REQUIRED(...)
SynchronizationState
Current sync state passed to tip changed callbacks.