aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorstickies-v <stickies-v@protonmail.com>2024-04-18 12:29:04 +0100
committerstickies-v <stickies-v@protonmail.com>2024-06-13 11:20:44 +0100
commitbed29c481aebeb2b0160450c63c03cc68fb89bc6 (patch)
tree70fed4a02abb9639bd30758f471f2865dae280f7 /src
parentff21eb2def701585fb1c286d8aef6dee86be48c3 (diff)
downloadbitcoin-bed29c481aebeb2b0160450c63c03cc68fb89bc6.tar.xz
refactor: remove unnecessary AppendWarning helper function
Diffstat (limited to 'src')
-rw-r--r--src/validation.cpp17
1 files changed, 6 insertions, 11 deletions
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 <logging/timer.h>
#include <node/blockstorage.h>
#include <node/utxo_snapshot.h>
-#include <policy/v3_policy.h>
#include <policy/policy.h>
#include <policy/rbf.h>
#include <policy/settings.h>
+#include <policy/v3_policy.h>
#include <pow.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
@@ -57,6 +57,7 @@
#include <util/result.h>
#include <util/signalinterrupt.h>
#include <util/strencodings.h>
+#include <util/string.h>
#include <util/time.h>
#include <util/trace.h>
#include <util/translation.h>
@@ -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<bilingual_str> 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.