6#include <bitcoin-build-config.h>
23 if (!CLIENT_VERSION_IS_RELEASE) {
26 _(
"This is a pre-release test build - use at your own risk - do not use for mining or merchant applications")});
31 const auto& [
_, inserted]{
WITH_LOCK(
m_mutex,
return m_warnings.insert({id, std::move(message)}))};
46 std::vector<bilingual_str> messages;
47 messages.reserve(m_warnings.size());
48 for (
const auto& [
id, msg] : m_warnings) {
49 messages.push_back(msg);
58 return all_messages.empty() ?
"" : all_messages.back().original;
63 messages.push_back(std::move(message.original));
Manages warning messages within a node.
std::variant< kernel::Warning, node::Warning > warning_type
bool Unset(warning_type id) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Unset a warning message.
bool Set(warning_type id, bilingual_str message) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Set a warning message.
std::vector< bilingual_str > GetMessages() const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Return potential problems detected by the node, sorted by the warning_type id.
CClientUIInterface uiInterface
UniValue GetWarningsForRpc(const Warnings &warnings, bool use_deprecated)
RPC helper function that wraps warnings.GetMessages().
#define WITH_LOCK(cs, code)
consteval auto _(util::TranslatedLiteral str)