@@ -741,7 +741,7 @@ void InitParameterInteraction()
741
741
LogPrintf (" %s: parameter interaction: -whitebind set -> setting -listen=1\n " , __func__);
742
742
}
743
743
744
- if (mapMultiArgs. count (" -connect" ) && mapMultiArgs. at (" -connect" ).size () > 0 ) {
744
+ if (gArgs . IsArgSet (" -connect" ) && gArgs . GetArgs (" -connect" ).size () > 0 ) {
745
745
// when only connecting to trusted nodes, do not seed via DNS, or listen by default
746
746
if (SoftSetBoolArg (" -dnsseed" , false ))
747
747
LogPrintf (" %s: parameter interaction: -connect set -> setting -dnsseed=0\n " , __func__);
@@ -895,8 +895,8 @@ bool AppInitParameterInteraction()
895
895
896
896
// Make sure enough file descriptors are available
897
897
int nBind = std::max (
898
- (mapMultiArgs. count (" -bind" ) ? mapMultiArgs. at (" -bind" ).size () : 0 ) +
899
- (mapMultiArgs. count (" -whitebind" ) ? mapMultiArgs. at (" -whitebind" ).size () : 0 ), size_t (1 ));
898
+ (gArgs . IsArgSet (" -bind" ) ? gArgs . GetArgs (" -bind" ).size () : 0 ) +
899
+ (gArgs . IsArgSet (" -whitebind" ) ? gArgs . GetArgs (" -whitebind" ).size () : 0 ), size_t (1 ));
900
900
nUserMaxConnections = GetArg (" -maxconnections" , DEFAULT_MAX_PEER_CONNECTIONS);
901
901
nMaxConnections = std::max (nUserMaxConnections, 0 );
902
902
@@ -911,9 +911,9 @@ bool AppInitParameterInteraction()
911
911
InitWarning (strprintf (_ (" Reducing -maxconnections from %d to %d, because of system limitations." ), nUserMaxConnections, nMaxConnections));
912
912
913
913
// ********************************************************* Step 3: parameter-to-internal-flags
914
- if (mapMultiArgs. count (" -debug" ) > 0 ) {
914
+ if (gArgs . IsArgSet (" -debug" ) > 0 ) {
915
915
// Special-case: if -debug=0/-nodebug is set, turn off debugging messages
916
- const std::vector<std::string>& categories = mapMultiArgs. at (" -debug" );
916
+ const std::vector<std::string>& categories = gArgs . GetArgs (" -debug" );
917
917
918
918
if (find (categories.begin (), categories.end (), std::string (" 0" )) == categories.end ()) {
919
919
for (const auto & cat : categories) {
@@ -928,8 +928,8 @@ bool AppInitParameterInteraction()
928
928
}
929
929
930
930
// Now remove the logging categories which were explicitly excluded
931
- if (mapMultiArgs. count (" -debugexclude" ) > 0 ) {
932
- const std::vector<std::string>& excludedCategories = mapMultiArgs. at (" -debugexclude" );
931
+ if (gArgs . IsArgSet (" -debugexclude" ) > 0 ) {
932
+ const std::vector<std::string>& excludedCategories = gArgs . GetArgs (" -debugexclude" );
933
933
for (const auto & cat : excludedCategories) {
934
934
uint32_t flag = 0 ;
935
935
if (!GetLogCategory (&flag, &cat)) {
@@ -1100,12 +1100,12 @@ bool AppInitParameterInteraction()
1100
1100
fEnableReplacement = (std::find (vstrReplacementModes.begin (), vstrReplacementModes.end (), " fee" ) != vstrReplacementModes.end ());
1101
1101
}
1102
1102
1103
- if (mapMultiArgs. count (" -bip9params" )) {
1103
+ if (gArgs . IsArgSet (" -bip9params" )) {
1104
1104
// Allow overriding BIP9 parameters for testing
1105
1105
if (!chainparams.MineBlocksOnDemand ()) {
1106
1106
return InitError (" BIP9 parameters may only be overridden on regtest." );
1107
1107
}
1108
- const std::vector<std::string>& deployments = mapMultiArgs. at (" -bip9params" );
1108
+ const std::vector<std::string>& deployments = gArgs . GetArgs (" -bip9params" );
1109
1109
for (auto i : deployments) {
1110
1110
std::vector<std::string> vDeploymentParams;
1111
1111
boost::split (vDeploymentParams, i, boost::is_any_of (" :" ));
@@ -1254,8 +1254,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1254
1254
1255
1255
// sanitize comments per BIP-0014, format user agent and check total size
1256
1256
std::vector<std::string> uacomments;
1257
- if (mapMultiArgs. count (" -uacomment" )) {
1258
- BOOST_FOREACH (std::string cmt, mapMultiArgs. at (" -uacomment" ))
1257
+ if (gArgs . IsArgSet (" -uacomment" )) {
1258
+ BOOST_FOREACH (std::string cmt, gArgs . GetArgs (" -uacomment" ))
1259
1259
{
1260
1260
if (cmt != SanitizeString (cmt, SAFE_CHARS_UA_COMMENT))
1261
1261
return InitError (strprintf (_ (" User Agent comment (%s) contains unsafe characters." ), cmt));
@@ -1268,9 +1268,9 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1268
1268
strSubVersion.size (), MAX_SUBVERSION_LENGTH));
1269
1269
}
1270
1270
1271
- if (mapMultiArgs. count (" -onlynet" )) {
1271
+ if (gArgs . IsArgSet (" -onlynet" )) {
1272
1272
std::set<enum Network> nets;
1273
- BOOST_FOREACH (const std::string& snet, mapMultiArgs. at (" -onlynet" )) {
1273
+ BOOST_FOREACH (const std::string& snet, gArgs . GetArgs (" -onlynet" )) {
1274
1274
enum Network net = ParseNetwork (snet);
1275
1275
if (net == NET_UNROUTABLE)
1276
1276
return InitError (strprintf (_ (" Unknown network specified in -onlynet: '%s'" ), snet));
@@ -1283,8 +1283,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1283
1283
}
1284
1284
}
1285
1285
1286
- if (mapMultiArgs. count (" -whitelist" )) {
1287
- BOOST_FOREACH (const std::string& net, mapMultiArgs. at (" -whitelist" )) {
1286
+ if (gArgs . IsArgSet (" -whitelist" )) {
1287
+ BOOST_FOREACH (const std::string& net, gArgs . GetArgs (" -whitelist" )) {
1288
1288
CSubNet subnet;
1289
1289
LookupSubNet (net.c_str (), subnet);
1290
1290
if (!subnet.IsValid ())
@@ -1345,16 +1345,16 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1345
1345
1346
1346
if (fListen ) {
1347
1347
bool fBound = false ;
1348
- if (mapMultiArgs. count (" -bind" )) {
1349
- BOOST_FOREACH (const std::string& strBind, mapMultiArgs. at (" -bind" )) {
1348
+ if (gArgs . IsArgSet (" -bind" )) {
1349
+ BOOST_FOREACH (const std::string& strBind, gArgs . GetArgs (" -bind" )) {
1350
1350
CService addrBind;
1351
1351
if (!Lookup (strBind.c_str (), addrBind, GetListenPort (), false ))
1352
1352
return InitError (ResolveErrMsg (" bind" , strBind));
1353
1353
fBound |= Bind (connman, addrBind, (BF_EXPLICIT | BF_REPORT_ERROR));
1354
1354
}
1355
1355
}
1356
- if (mapMultiArgs. count (" -whitebind" )) {
1357
- BOOST_FOREACH (const std::string& strBind, mapMultiArgs. at (" -whitebind" )) {
1356
+ if (gArgs . IsArgSet (" -whitebind" )) {
1357
+ BOOST_FOREACH (const std::string& strBind, gArgs . GetArgs (" -whitebind" )) {
1358
1358
CService addrBind;
1359
1359
if (!Lookup (strBind.c_str (), addrBind, 0 , false ))
1360
1360
return InitError (ResolveErrMsg (" whitebind" , strBind));
@@ -1363,7 +1363,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1363
1363
fBound |= Bind (connman, addrBind, (BF_EXPLICIT | BF_REPORT_ERROR | BF_WHITELIST));
1364
1364
}
1365
1365
}
1366
- if (!mapMultiArgs. count (" -bind" ) && !mapMultiArgs. count (" -whitebind" )) {
1366
+ if (!gArgs . IsArgSet (" -bind" ) && !gArgs . IsArgSet (" -whitebind" )) {
1367
1367
struct in_addr inaddr_any;
1368
1368
inaddr_any.s_addr = INADDR_ANY;
1369
1369
fBound |= Bind (connman, CService (in6addr_any, GetListenPort ()), BF_NONE);
@@ -1373,8 +1373,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1373
1373
return InitError (_ (" Failed to listen on any port. Use -listen=0 if you want this." ));
1374
1374
}
1375
1375
1376
- if (mapMultiArgs. count (" -externalip" )) {
1377
- BOOST_FOREACH (const std::string& strAddr, mapMultiArgs. at (" -externalip" )) {
1376
+ if (gArgs . IsArgSet (" -externalip" )) {
1377
+ BOOST_FOREACH (const std::string& strAddr, gArgs . GetArgs (" -externalip" )) {
1378
1378
CService addrLocal;
1379
1379
if (Lookup (strAddr.c_str (), addrLocal, GetListenPort (), fNameLookup ) && addrLocal.IsValid ())
1380
1380
AddLocal (addrLocal, LOCAL_MANUAL);
@@ -1383,8 +1383,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1383
1383
}
1384
1384
}
1385
1385
1386
- if (mapMultiArgs. count (" -seednode" )) {
1387
- BOOST_FOREACH (const std::string& strDest, mapMultiArgs. at (" -seednode" ))
1386
+ if (gArgs . IsArgSet (" -seednode" )) {
1387
+ BOOST_FOREACH (const std::string& strDest, gArgs . GetArgs (" -seednode" ))
1388
1388
connman.AddOneShot (strDest);
1389
1389
}
1390
1390
@@ -1610,9 +1610,9 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
1610
1610
uiInterface.NotifyBlockTip .connect (BlockNotifyCallback);
1611
1611
1612
1612
std::vector<fs::path> vImportFiles;
1613
- if (mapMultiArgs. count (" -loadblock" ))
1613
+ if (gArgs . IsArgSet (" -loadblock" ))
1614
1614
{
1615
- BOOST_FOREACH (const std::string& strFile, mapMultiArgs. at (" -loadblock" ))
1615
+ BOOST_FOREACH (const std::string& strFile, gArgs . GetArgs (" -loadblock" ))
1616
1616
vImportFiles.push_back (strFile);
1617
1617
}
1618
1618
0 commit comments