aboutsummaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
authorTheCharlatan <seb.kung@gmail.com>2024-03-15 21:42:44 +0100
committerTheCharlatan <seb.kung@gmail.com>2024-03-21 16:40:22 +0100
commitddc7872c08b7ddf9b1e83abdb97c21303f4a9172 (patch)
treec63f192aea2ef0dc8e14532720afbea46f21853a /src/kernel
parentb50554babdddf452acaa51bac757736766c70e81 (diff)
downloadbitcoin-ddc7872c08b7ddf9b1e83abdb97c21303f4a9172.tar.xz
node: Make translations of fatal errors consistent
The extra `bilingual_str` argument of the fatal error notifications and `node::AbortNode()` is often unused and when used usually contains the same string as the message argument. It also seems to be confusing, since it is not consistently used for errors requiring user action. For example some assumeutxo fatal errors require the user to do something, but are not translated. So simplify the fatal error and abort node interfaces by only passing a translated string. This slightly changes the fatal errors displayed to the user. Also de-duplicate the abort error log since it is repeated in noui.cpp.
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/notifications_interface.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/kernel/notifications_interface.h b/src/kernel/notifications_interface.h
index c5e77b0df9..7283a88e86 100644
--- a/src/kernel/notifications_interface.h
+++ b/src/kernel/notifications_interface.h
@@ -5,14 +5,12 @@
#ifndef BITCOIN_KERNEL_NOTIFICATIONS_INTERFACE_H
#define BITCOIN_KERNEL_NOTIFICATIONS_INTERFACE_H
-#include <util/translation.h>
-
#include <cstdint>
-#include <string>
#include <variant>
class CBlockIndex;
enum class SynchronizationState;
+struct bilingual_str;
namespace kernel {
@@ -48,7 +46,7 @@ public:
//! 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.
- virtual void flushError(const std::string& debug_message) {}
+ virtual void flushError(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. After this
@@ -57,7 +55,7 @@ public:
//! 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.
- virtual void fatalError(const std::string& debug_message, const bilingual_str& user_message = {}) {}
+ virtual void fatalError(const bilingual_str& message) {}
};
} // namespace kernel