45
45
#include < sstream>
46
46
47
47
#include < boost/algorithm/string/replace.hpp>
48
- #include < boost/algorithm/string/join.hpp>
49
48
#include < boost/thread.hpp>
50
49
51
50
#if defined(NDEBUG)
@@ -2242,6 +2241,13 @@ static void DoWarning(const std::string& strWarning)
2242
2241
}
2243
2242
}
2244
2243
2244
+ /* * Private helper function that concatenates warning messages. */
2245
+ static void AppendWarning (std::string& res, const std::string& warn)
2246
+ {
2247
+ if (!res.empty ()) res += " , " ;
2248
+ res += warn;
2249
+ }
2250
+
2245
2251
/* * Check warning conditions and do some notifications on new chain tip set. */
2246
2252
void static UpdateTip (const CBlockIndex *pindexNew, const CChainParams& chainParams) {
2247
2253
// New best block
@@ -2253,7 +2259,7 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
2253
2259
g_best_block_cv.notify_all ();
2254
2260
}
2255
2261
2256
- std::vector<std:: string> warningMessages;
2262
+ std::string warningMessages;
2257
2263
if (!IsInitialBlockDownload ())
2258
2264
{
2259
2265
int nUpgraded = 0 ;
@@ -2266,7 +2272,7 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
2266
2272
if (state == ThresholdState::ACTIVE) {
2267
2273
DoWarning (strWarning);
2268
2274
} else {
2269
- warningMessages. push_back ( strWarning);
2275
+ AppendWarning (warningMessages, strWarning);
2270
2276
}
2271
2277
}
2272
2278
}
@@ -2279,7 +2285,7 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
2279
2285
pindex = pindex->pprev ;
2280
2286
}
2281
2287
if (nUpgraded > 0 )
2282
- warningMessages. push_back ( strprintf (_ (" %d of last 100 blocks have unexpected version" ), nUpgraded));
2288
+ AppendWarning (warningMessages, strprintf (_ (" %d of last 100 blocks have unexpected version" ), nUpgraded));
2283
2289
if (nUpgraded > 100 /2 )
2284
2290
{
2285
2291
std::string strWarning = _ (" Warning: Unknown block versions being mined! It's possible unknown rules are in effect" );
@@ -2293,7 +2299,7 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
2293
2299
FormatISO8601DateTime (pindexNew->GetBlockTime ()),
2294
2300
GuessVerificationProgress (chainParams.TxData (), pindexNew), pcoinsTip->DynamicMemoryUsage () * (1.0 / (1 <<20 )), pcoinsTip->GetCacheSize ());
2295
2301
if (!warningMessages.empty ())
2296
- LogPrintf (" warning='%s'" , boost::algorithm::join ( warningMessages, " , " ) ); /* Continued */
2302
+ LogPrintf (" warning='%s'" , warningMessages); /* Continued */
2297
2303
LogPrintf (" \n " );
2298
2304
2299
2305
}
0 commit comments