mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 03:33:32 +01:00
node: update uiInterface whenever warnings updated
This commit introduces slight behaviour change. Previously, the GUI status bar would be updated for most warnings, namely UNKNOWN_NEW_RULES_ACTIVATED, CLOCK_OUT_OF_SYNC and PRE_RELEASE_TEST_BUILD, but not for LARGE_WORK_INVALID_CHAIN (and not for FATAL_INTERNAL_ERROR, but that is not really meaningful). Fix this by always updating the status bar when the warnings are changed.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <node/warnings.h>
|
||||
|
||||
#include <common/system.h>
|
||||
#include <node/interface_ui.h>
|
||||
#include <sync.h>
|
||||
#include <univalue.h>
|
||||
#include <util/translation.h>
|
||||
@@ -31,12 +32,15 @@ bool Warnings::Set(warning_type id, bilingual_str message)
|
||||
{
|
||||
LOCK(m_mutex);
|
||||
const auto& [_, inserted]{m_warnings.insert({id, std::move(message)})};
|
||||
if (inserted) uiInterface.NotifyAlertChanged();
|
||||
return inserted;
|
||||
}
|
||||
|
||||
bool Warnings::Unset(warning_type id)
|
||||
{
|
||||
return WITH_LOCK(m_mutex, return m_warnings.erase(id));
|
||||
auto success{WITH_LOCK(m_mutex, return m_warnings.erase(id))};
|
||||
if (success) uiInterface.NotifyAlertChanged();
|
||||
return success;
|
||||
}
|
||||
|
||||
std::vector<bilingual_str> Warnings::GetMessages() const
|
||||
|
||||
Reference in New Issue
Block a user