forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 2
/
kernel_notifications.h
38 lines (26 loc) · 1.2 KB
/
kernel_notifications.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2023 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_NODE_KERNEL_NOTIFICATIONS_H
#define BITCOIN_NODE_KERNEL_NOTIFICATIONS_H
#include <kernel/notifications_interface.h>
#include <cstdint>
#include <string>
class CBlockIndex;
enum class SynchronizationState;
struct bilingual_str;
namespace node {
class KernelNotifications : public kernel::Notifications
{
public:
void 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 warning(const bilingual_str& warning) override;
void fatalError(const std::string& debug_message, const bilingual_str& user_message = {}) override;
void startShutdown(const kernel::ShutdownReason reason) override;
//! Useful for tests, can be set to false to avoid shutdown on fatal error.
bool m_shutdown_on_fatal_error{true};
};
} // namespace node
#endif // BITCOIN_NODE_KERNEL_NOTIFICATIONS_H