mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 19:37:27 -03:00
refactor: remove unnecessary AppendWarning helper function
This commit is contained in:
parent
ff21eb2def
commit
bed29c481a
1 changed files with 6 additions and 11 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue