@@ -741,7 +741,7 @@ void InitParameterInteraction()
741741 LogPrintf (" %s: parameter interaction: -whitebind set -> setting -listen=1\n " , __func__);
742742 }
743743
744- if (mapMultiArgs. count (" -connect" ) && mapMultiArgs. at (" -connect" ).size () > 0 ) {
744+ if (gArgs . IsArgSet (" -connect" ) && gArgs . GetArgs (" -connect" ).size () > 0 ) {
745745 // when only connecting to trusted nodes, do not seed via DNS, or listen by default
746746 if (SoftSetBoolArg (" -dnsseed" , false ))
747747 LogPrintf (" %s: parameter interaction: -connect set -> setting -dnsseed=0\n " , __func__);
@@ -895,8 +895,8 @@ bool AppInitParameterInteraction()
895895
896896 // Make sure enough file descriptors are available
897897 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 ));
900900 nUserMaxConnections = GetArg (" -maxconnections" , DEFAULT_MAX_PEER_CONNECTIONS);
901901 nMaxConnections = std::max (nUserMaxConnections, 0 );
902902
@@ -911,9 +911,9 @@ bool AppInitParameterInteraction()
911911 InitWarning (strprintf (_ (" Reducing -maxconnections from %d to %d, because of system limitations." ), nUserMaxConnections, nMaxConnections));
912912
913913 // ********************************************************* Step 3: parameter-to-internal-flags
914- if (mapMultiArgs. count (" -debug" ) > 0 ) {
914+ if (gArgs . IsArgSet (" -debug" ) > 0 ) {
915915 // 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" );
917917
918918 if (find (categories.begin (), categories.end (), std::string (" 0" )) == categories.end ()) {
919919 for (const auto & cat : categories) {
@@ -928,8 +928,8 @@ bool AppInitParameterInteraction()
928928 }
929929
930930 // 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" );
933933 for (const auto & cat : excludedCategories) {
934934 uint32_t flag = 0 ;
935935 if (!GetLogCategory (&flag, &cat)) {
@@ -1100,12 +1100,12 @@ bool AppInitParameterInteraction()
11001100 fEnableReplacement = (std::find (vstrReplacementModes.begin (), vstrReplacementModes.end (), " fee" ) != vstrReplacementModes.end ());
11011101 }
11021102
1103- if (mapMultiArgs. count (" -bip9params" )) {
1103+ if (gArgs . IsArgSet (" -bip9params" )) {
11041104 // Allow overriding BIP9 parameters for testing
11051105 if (!chainparams.MineBlocksOnDemand ()) {
11061106 return InitError (" BIP9 parameters may only be overridden on regtest." );
11071107 }
1108- const std::vector<std::string>& deployments = mapMultiArgs. at (" -bip9params" );
1108+ const std::vector<std::string>& deployments = gArgs . GetArgs (" -bip9params" );
11091109 for (auto i : deployments) {
11101110 std::vector<std::string> vDeploymentParams;
11111111 boost::split (vDeploymentParams, i, boost::is_any_of (" :" ));
@@ -1254,8 +1254,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
12541254
12551255 // sanitize comments per BIP-0014, format user agent and check total size
12561256 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" ))
12591259 {
12601260 if (cmt != SanitizeString (cmt, SAFE_CHARS_UA_COMMENT))
12611261 return InitError (strprintf (_ (" User Agent comment (%s) contains unsafe characters." ), cmt));
@@ -1268,9 +1268,9 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
12681268 strSubVersion.size (), MAX_SUBVERSION_LENGTH));
12691269 }
12701270
1271- if (mapMultiArgs. count (" -onlynet" )) {
1271+ if (gArgs . IsArgSet (" -onlynet" )) {
12721272 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" )) {
12741274 enum Network net = ParseNetwork (snet);
12751275 if (net == NET_UNROUTABLE)
12761276 return InitError (strprintf (_ (" Unknown network specified in -onlynet: '%s'" ), snet));
@@ -1283,8 +1283,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
12831283 }
12841284 }
12851285
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" )) {
12881288 CSubNet subnet;
12891289 LookupSubNet (net.c_str (), subnet);
12901290 if (!subnet.IsValid ())
@@ -1345,16 +1345,16 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
13451345
13461346 if (fListen ) {
13471347 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" )) {
13501350 CService addrBind;
13511351 if (!Lookup (strBind.c_str (), addrBind, GetListenPort (), false ))
13521352 return InitError (ResolveErrMsg (" bind" , strBind));
13531353 fBound |= Bind (connman, addrBind, (BF_EXPLICIT | BF_REPORT_ERROR));
13541354 }
13551355 }
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" )) {
13581358 CService addrBind;
13591359 if (!Lookup (strBind.c_str (), addrBind, 0 , false ))
13601360 return InitError (ResolveErrMsg (" whitebind" , strBind));
@@ -1363,7 +1363,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
13631363 fBound |= Bind (connman, addrBind, (BF_EXPLICIT | BF_REPORT_ERROR | BF_WHITELIST));
13641364 }
13651365 }
1366- if (!mapMultiArgs. count (" -bind" ) && !mapMultiArgs. count (" -whitebind" )) {
1366+ if (!gArgs . IsArgSet (" -bind" ) && !gArgs . IsArgSet (" -whitebind" )) {
13671367 struct in_addr inaddr_any;
13681368 inaddr_any.s_addr = INADDR_ANY;
13691369 fBound |= Bind (connman, CService (in6addr_any, GetListenPort ()), BF_NONE);
@@ -1373,8 +1373,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
13731373 return InitError (_ (" Failed to listen on any port. Use -listen=0 if you want this." ));
13741374 }
13751375
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" )) {
13781378 CService addrLocal;
13791379 if (Lookup (strAddr.c_str (), addrLocal, GetListenPort (), fNameLookup ) && addrLocal.IsValid ())
13801380 AddLocal (addrLocal, LOCAL_MANUAL);
@@ -1383,8 +1383,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
13831383 }
13841384 }
13851385
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" ))
13881388 connman.AddOneShot (strDest);
13891389 }
13901390
@@ -1610,9 +1610,9 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
16101610 uiInterface.NotifyBlockTip .connect (BlockNotifyCallback);
16111611
16121612 std::vector<fs::path> vImportFiles;
1613- if (mapMultiArgs. count (" -loadblock" ))
1613+ if (gArgs . IsArgSet (" -loadblock" ))
16141614 {
1615- BOOST_FOREACH (const std::string& strFile, mapMultiArgs. at (" -loadblock" ))
1615+ BOOST_FOREACH (const std::string& strFile, gArgs . GetArgs (" -loadblock" ))
16161616 vImportFiles.push_back (strFile);
16171617 }
16181618
0 commit comments