From bed29c481aebeb2b0160450c63c03cc68fb89bc6 Mon Sep 17 00:00:00 2001 From: stickies-v Date: Thu, 18 Apr 2024 12:29:04 +0100 Subject: refactor: remove unnecessary AppendWarning helper function --- src/validation.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/validation.cpp b/src/validation.cpp index e066ee16cb..9f8cb5f994 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -31,10 +31,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -2847,13 +2848,6 @@ void Chainstate::PruneAndFlush() } } -/** Private helper function that concatenates warning messages. */ -static void AppendWarning(bilingual_str& res, const bilingual_str& warn) -{ - if (!res.empty()) res += Untranslated(", "); - res += warn; -} - static void UpdateTipLog( const CCoinsViewCache& coins_tip, const CBlockIndex* tip, @@ -2904,7 +2898,7 @@ void Chainstate::UpdateTip(const CBlockIndex* pindexNew) g_best_block_cv.notify_all(); } - bilingual_str warning_messages; + std::vector warning_messages; if (!m_chainman.IsInitialBlockDownload()) { const CBlockIndex* pindex = pindexNew; for (int bit = 0; bit < VERSIONBITS_NUM_BITS; bit++) { @@ -2915,12 +2909,13 @@ void Chainstate::UpdateTip(const CBlockIndex* pindexNew) if (state == ThresholdState::ACTIVE) { m_chainman.GetNotifications().warning(warning); } else { - AppendWarning(warning_messages, warning); + warning_messages.push_back(warning); } } } } - UpdateTipLog(coins_tip, pindexNew, params, __func__, "", warning_messages.original); + UpdateTipLog(coins_tip, pindexNew, params, __func__, "", + util::Join(warning_messages, Untranslated(", ")).original); } /** Disconnect m_chain's tip. -- cgit v1.2.3