Bitcoin ABC 0.32.4
P2P Digital Currency
kernel_notifications.h
Go to the documentation of this file.
1// Copyright (c) 2023 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_NODE_KERNEL_NOTIFICATIONS_H
6#define BITCOIN_NODE_KERNEL_NOTIFICATIONS_H
7
9
10#include <atomic>
11#include <cstdint>
12
13class CBlockIndex;
14enum class SynchronizationState;
15struct bilingual_str;
16
17namespace node {
19public:
20 KernelNotifications(std::atomic<int> &exit_status)
21 : m_exit_status{exit_status} {}
22
23 void blockTip(SynchronizationState state, CBlockIndex &index) override;
24
25 void headerTip(SynchronizationState state, int64_t height,
26 int64_t timestamp, bool presync) override;
27
28 void progress(const bilingual_str &title, int progress_percent,
29 bool resume_possible) override;
30
31 void warning(const std::string &warning) override;
32
33 void flushError(const std::string &debug_message) override;
34
35 void fatalError(const std::string &debug_message,
36 const bilingual_str &user_message = {}) override;
37
40
41private:
42 std::atomic<int> &m_exit_status;
43};
44} // namespace node
45
46#endif // BITCOIN_NODE_KERNEL_NOTIFICATIONS_H
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: blockindex.h:25
A base class defining functions for notifying about certain kernel events.
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 flushError(const std::string &debug_message) override
The flush error notification is sent to notify the user that an error occurred while flushing block d...
void warning(const std::string &warning) override
void fatalError(const std::string &debug_message, const bilingual_str &user_message={}) override
The fatal error notification is sent to notify the user when an error occurs in kernel code that can'...
void blockTip(SynchronizationState state, CBlockIndex &index) override
KernelNotifications(std::atomic< int > &exit_status)
bool m_shutdown_on_fatal_error
Useful for tests, can be set to false to avoid shutdown on fatal error.
Definition: init.h:31
Bilingual messages:
Definition: translation.h:17
SynchronizationState
Current sync state passed to tip changed callbacks.
Definition: validation.h:119