@@ -611,7 +611,7 @@ void CleanupBlockRevFiles()
611
611
// keeping a separate counter. Once we hit a gap (or if 0 doesn't exist)
612
612
// start removing block files.
613
613
int nContigCounter = 0 ;
614
- BOOST_FOREACH (const PAIRTYPE (std::string, fs::path)& item, mapBlockFiles) {
614
+ for (const PAIRTYPE (std::string, fs::path)& item : mapBlockFiles) {
615
615
if (atoi (item.first ) == nContigCounter) {
616
616
nContigCounter++;
617
617
continue ;
@@ -664,7 +664,7 @@ void ThreadImport(std::vector<fs::path> vImportFiles)
664
664
}
665
665
666
666
// -loadblock=
667
- BOOST_FOREACH (const fs::path& path, vImportFiles) {
667
+ for (const fs::path& path : vImportFiles) {
668
668
FILE *file = fsbridge::fopen (path, " rb" );
669
669
if (file) {
670
670
LogPrintf (" Importing blocks file %s...\n " , path.string ());
@@ -1258,7 +1258,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1258
1258
// sanitize comments per BIP-0014, format user agent and check total size
1259
1259
std::vector<std::string> uacomments;
1260
1260
if (gArgs .IsArgSet (" -uacomment" )) {
1261
- BOOST_FOREACH (std::string cmt, gArgs .GetArgs (" -uacomment" ))
1261
+ for (std::string cmt : gArgs .GetArgs (" -uacomment" ))
1262
1262
{
1263
1263
if (cmt != SanitizeString (cmt, SAFE_CHARS_UA_COMMENT))
1264
1264
return InitError (strprintf (_ (" User Agent comment (%s) contains unsafe characters." ), cmt));
@@ -1273,7 +1273,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1273
1273
1274
1274
if (gArgs .IsArgSet (" -onlynet" )) {
1275
1275
std::set<enum Network> nets;
1276
- BOOST_FOREACH (const std::string& snet, gArgs .GetArgs (" -onlynet" )) {
1276
+ for (const std::string& snet : gArgs .GetArgs (" -onlynet" )) {
1277
1277
enum Network net = ParseNetwork (snet);
1278
1278
if (net == NET_UNROUTABLE)
1279
1279
return InitError (strprintf (_ (" Unknown network specified in -onlynet: '%s'" ), snet));
@@ -1287,7 +1287,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1287
1287
}
1288
1288
1289
1289
if (gArgs .IsArgSet (" -whitelist" )) {
1290
- BOOST_FOREACH (const std::string& net, gArgs .GetArgs (" -whitelist" )) {
1290
+ for (const std::string& net : gArgs .GetArgs (" -whitelist" )) {
1291
1291
CSubNet subnet;
1292
1292
LookupSubNet (net.c_str (), subnet);
1293
1293
if (!subnet.IsValid ())
@@ -1349,15 +1349,15 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1349
1349
if (fListen ) {
1350
1350
bool fBound = false ;
1351
1351
if (gArgs .IsArgSet (" -bind" )) {
1352
- BOOST_FOREACH (const std::string& strBind, gArgs .GetArgs (" -bind" )) {
1352
+ for (const std::string& strBind : gArgs .GetArgs (" -bind" )) {
1353
1353
CService addrBind;
1354
1354
if (!Lookup (strBind.c_str (), addrBind, GetListenPort (), false ))
1355
1355
return InitError (ResolveErrMsg (" bind" , strBind));
1356
1356
fBound |= Bind (connman, addrBind, (BF_EXPLICIT | BF_REPORT_ERROR));
1357
1357
}
1358
1358
}
1359
1359
if (gArgs .IsArgSet (" -whitebind" )) {
1360
- BOOST_FOREACH (const std::string& strBind, gArgs .GetArgs (" -whitebind" )) {
1360
+ for (const std::string& strBind : gArgs .GetArgs (" -whitebind" )) {
1361
1361
CService addrBind;
1362
1362
if (!Lookup (strBind.c_str (), addrBind, 0 , false ))
1363
1363
return InitError (ResolveErrMsg (" whitebind" , strBind));
@@ -1377,7 +1377,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1377
1377
}
1378
1378
1379
1379
if (gArgs .IsArgSet (" -externalip" )) {
1380
- BOOST_FOREACH (const std::string& strAddr, gArgs .GetArgs (" -externalip" )) {
1380
+ for (const std::string& strAddr : gArgs .GetArgs (" -externalip" )) {
1381
1381
CService addrLocal;
1382
1382
if (Lookup (strAddr.c_str (), addrLocal, GetListenPort (), fNameLookup ) && addrLocal.IsValid ())
1383
1383
AddLocal (addrLocal, LOCAL_MANUAL);
@@ -1616,7 +1616,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1616
1616
std::vector<fs::path> vImportFiles;
1617
1617
if (gArgs .IsArgSet (" -loadblock" ))
1618
1618
{
1619
- BOOST_FOREACH (const std::string& strFile, gArgs .GetArgs (" -loadblock" ))
1619
+ for (const std::string& strFile : gArgs .GetArgs (" -loadblock" ))
1620
1620
vImportFiles.push_back (strFile);
1621
1621
}
1622
1622
0 commit comments