@@ -843,7 +843,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
843843 }
844844
845845 // if using block pruning, then disallow txindex and coinstatsindex
846- if (args.GetArg (" -prune" , 0 )) {
846+ if (args.GetIntArg (" -prune" , 0 )) {
847847 if (args.GetBoolArg (" -txindex" , DEFAULT_TXINDEX))
848848 return InitError (_ (" Prune mode is incompatible with -txindex." ));
849849 if (args.GetBoolArg (" -coinstatsindex" , DEFAULT_COINSTATSINDEX))
@@ -868,7 +868,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
868868
869869 // Make sure enough file descriptors are available
870870 int nBind = std::max (nUserBind, size_t (1 ));
871- nUserMaxConnections = args.GetArg (" -maxconnections" , DEFAULT_MAX_PEER_CONNECTIONS);
871+ nUserMaxConnections = args.GetIntArg (" -maxconnections" , DEFAULT_MAX_PEER_CONNECTIONS);
872872 nMaxConnections = std::max (nUserMaxConnections, 0 );
873873
874874 nFD = RaiseFileDescriptorLimit (nMaxConnections + MIN_CORE_FILEDESCRIPTORS + MAX_ADDNODE_CONNECTIONS + nBind + NUM_FDS_MESSAGE_CAPTURE);
@@ -913,8 +913,8 @@ bool AppInitParameterInteraction(const ArgsManager& args)
913913 }
914914
915915 // mempool limits
916- int64_t nMempoolSizeMax = args.GetArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 ;
917- int64_t nMempoolSizeMin = args.GetArg (" -limitdescendantsize" , DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40 ;
916+ int64_t nMempoolSizeMax = args.GetIntArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 ;
917+ int64_t nMempoolSizeMin = args.GetIntArg (" -limitdescendantsize" , DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40 ;
918918 if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin)
919919 return InitError (strprintf (_ (" -maxmempool must be at least %d MB" ), std::ceil (nMempoolSizeMin / 1000000.0 )));
920920 // incremental relay fee sets the minimum feerate increase necessary for BIP 125 replacement in the mempool
@@ -928,7 +928,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
928928 }
929929
930930 // block pruning; get the amount of disk space (in MiB) to allot for block & undo files
931- int64_t nPruneArg = args.GetArg (" -prune" , 0 );
931+ int64_t nPruneArg = args.GetIntArg (" -prune" , 0 );
932932 if (nPruneArg < 0 ) {
933933 return InitError (_ (" Prune cannot be configured with a negative value." ));
934934 }
@@ -945,12 +945,12 @@ bool AppInitParameterInteraction(const ArgsManager& args)
945945 fPruneMode = true ;
946946 }
947947
948- nConnectTimeout = args.GetArg (" -timeout" , DEFAULT_CONNECT_TIMEOUT);
948+ nConnectTimeout = args.GetIntArg (" -timeout" , DEFAULT_CONNECT_TIMEOUT);
949949 if (nConnectTimeout <= 0 ) {
950950 nConnectTimeout = DEFAULT_CONNECT_TIMEOUT;
951951 }
952952
953- peer_connect_timeout = args.GetArg (" -peertimeout" , DEFAULT_PEER_CONNECT_TIMEOUT);
953+ peer_connect_timeout = args.GetIntArg (" -peertimeout" , DEFAULT_PEER_CONNECT_TIMEOUT);
954954 if (peer_connect_timeout <= 0 ) {
955955 return InitError (Untranslated (" peertimeout cannot be configured with a negative value." ));
956956 }
@@ -990,27 +990,27 @@ bool AppInitParameterInteraction(const ArgsManager& args)
990990 if (!chainparams.IsTestChain () && !fRequireStandard ) {
991991 return InitError (strprintf (Untranslated (" acceptnonstdtxn is not currently supported for %s chain" ), chainparams.NetworkIDString ()));
992992 }
993- nBytesPerSigOp = args.GetArg (" -bytespersigop" , nBytesPerSigOp);
993+ nBytesPerSigOp = args.GetIntArg (" -bytespersigop" , nBytesPerSigOp);
994994
995995 if (!g_wallet_init_interface.ParameterInteraction ()) return false ;
996996
997997 fIsBareMultisigStd = args.GetBoolArg (" -permitbaremultisig" , DEFAULT_PERMIT_BAREMULTISIG);
998998 fAcceptDatacarrier = args.GetBoolArg (" -datacarrier" , DEFAULT_ACCEPT_DATACARRIER);
999- nMaxDatacarrierBytes = args.GetArg (" -datacarriersize" , nMaxDatacarrierBytes);
999+ nMaxDatacarrierBytes = args.GetIntArg (" -datacarriersize" , nMaxDatacarrierBytes);
10001000
10011001 // Option to startup with mocktime set (used for regression testing):
1002- SetMockTime (args.GetArg (" -mocktime" , 0 )); // SetMockTime(0) is a no-op
1002+ SetMockTime (args.GetIntArg (" -mocktime" , 0 )); // SetMockTime(0) is a no-op
10031003
10041004 if (args.GetBoolArg (" -peerbloomfilters" , DEFAULT_PEERBLOOMFILTERS))
10051005 nLocalServices = ServiceFlags (nLocalServices | NODE_BLOOM);
10061006
1007- if (args.GetArg (" -rpcserialversion" , DEFAULT_RPC_SERIALIZE_VERSION) < 0 )
1007+ if (args.GetIntArg (" -rpcserialversion" , DEFAULT_RPC_SERIALIZE_VERSION) < 0 )
10081008 return InitError (Untranslated (" rpcserialversion must be non-negative." ));
10091009
1010- if (args.GetArg (" -rpcserialversion" , DEFAULT_RPC_SERIALIZE_VERSION) > 1 )
1010+ if (args.GetIntArg (" -rpcserialversion" , DEFAULT_RPC_SERIALIZE_VERSION) > 1 )
10111011 return InitError (Untranslated (" Unknown rpcserialversion requested." ));
10121012
1013- nMaxTipAge = args.GetArg (" -maxtipage" , DEFAULT_MAX_TIP_AGE);
1013+ nMaxTipAge = args.GetIntArg (" -maxtipage" , DEFAULT_MAX_TIP_AGE);
10141014
10151015 if (args.IsArgSet (" -proxy" ) && args.GetArg (" -proxy" , " " ).empty ()) {
10161016 return InitError (_ (" No proxy server specified. Use -proxy=<ip> or -proxy=<ip:port>." ));
@@ -1099,7 +1099,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
10991099 InitSignatureCache ();
11001100 InitScriptExecutionCache ();
11011101
1102- int script_threads = args.GetArg (" -par" , DEFAULT_SCRIPTCHECK_THREADS);
1102+ int script_threads = args.GetIntArg (" -par" , DEFAULT_SCRIPTCHECK_THREADS);
11031103 if (script_threads <= 0 ) {
11041104 // -par=0 means autodetect (number of cores - 1 script threads)
11051105 // -par=-n means "leave n cores free" (number of cores - n - 1 script threads)
@@ -1206,7 +1206,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
12061206 }
12071207
12081208 assert (!node.banman );
1209- node.banman = std::make_unique<BanMan>(gArgs .GetDataDirNet () / " banlist" , &uiInterface, args.GetArg (" -bantime" , DEFAULT_MISBEHAVING_BANTIME));
1209+ node.banman = std::make_unique<BanMan>(gArgs .GetDataDirNet () / " banlist" , &uiInterface, args.GetIntArg (" -bantime" , DEFAULT_MISBEHAVING_BANTIME));
12101210 assert (!node.connman );
12111211 node.connman = std::make_unique<CConnman>(GetRand (std::numeric_limits<uint64_t >::max ()), GetRand (std::numeric_limits<uint64_t >::max ()), *node.addrman , args.GetBoolArg (" -networkactive" , true ));
12121212
@@ -1216,7 +1216,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
12161216 if (!ignores_incoming_txs) node.fee_estimator = std::make_unique<CBlockPolicyEstimator>();
12171217
12181218 assert (!node.mempool );
1219- int check_ratio = std::min<int >(std::max<int >(args.GetArg (" -checkmempool" , chainparams.DefaultConsistencyChecks () ? 1 : 0 ), 0 ), 1000000 );
1219+ int check_ratio = std::min<int >(std::max<int >(args.GetIntArg (" -checkmempool" , chainparams.DefaultConsistencyChecks () ? 1 : 0 ), 0 ), 1000000 );
12201220 node.mempool = std::make_unique<CTxMemPool>(node.fee_estimator .get (), check_ratio);
12211221
12221222 assert (!node.chainman );
@@ -1323,7 +1323,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
13231323 bool fReindexChainState = args.GetBoolArg (" -reindex-chainstate" , false );
13241324
13251325 // cache size calculations
1326- int64_t nTotalCache = (args.GetArg (" -dbcache" , nDefaultDbCache) << 20 );
1326+ int64_t nTotalCache = (args.GetIntArg (" -dbcache" , nDefaultDbCache) << 20 );
13271327 nTotalCache = std::max (nTotalCache, nMinDbCache << 20 ); // total cache cannot be less than nMinDbCache
13281328 nTotalCache = std::min (nTotalCache, nMaxDbCache << 20 ); // total cache cannot be greater than nMaxDbcache
13291329 int64_t nBlockTreeDBCache = std::min (nTotalCache / 8 , nMaxBlockDBCache << 20 );
@@ -1341,7 +1341,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
13411341 nCoinDBCache = std::min (nCoinDBCache, nMaxCoinsDBCache << 20 ); // cap total coins db cache
13421342 nTotalCache -= nCoinDBCache;
13431343 int64_t nCoinCacheUsage = nTotalCache; // the rest goes to in-memory cache
1344- int64_t nMempoolSizeMax = args.GetArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 ;
1344+ int64_t nMempoolSizeMax = args.GetIntArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 ;
13451345 LogPrintf (" Cache configuration:\n " );
13461346 LogPrintf (" * Using %.1f MiB for block index database\n " , nBlockTreeDBCache * (1.0 / 1024 / 1024 ));
13471347 if (args.GetBoolArg (" -txindex" , DEFAULT_TXINDEX)) {
@@ -1497,7 +1497,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
14971497 for (CChainState* chainstate : chainman.GetAll ()) {
14981498 if (!is_coinsview_empty (chainstate)) {
14991499 uiInterface.InitMessage (_ (" Verifying blocks…" ).translated );
1500- if (fHavePruned && args.GetArg (" -checkblocks" , DEFAULT_CHECKBLOCKS) > MIN_BLOCKS_TO_KEEP) {
1500+ if (fHavePruned && args.GetIntArg (" -checkblocks" , DEFAULT_CHECKBLOCKS) > MIN_BLOCKS_TO_KEEP) {
15011501 LogPrintf (" Prune: pruned datadir may not have more than %d blocks; only checking available blocks\n " ,
15021502 MIN_BLOCKS_TO_KEEP);
15031503 }
@@ -1514,8 +1514,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
15141514
15151515 if (!CVerifyDB ().VerifyDB (
15161516 *chainstate, chainparams, chainstate->CoinsDB (),
1517- args.GetArg (" -checklevel" , DEFAULT_CHECKLEVEL),
1518- args.GetArg (" -checkblocks" , DEFAULT_CHECKBLOCKS))) {
1517+ args.GetIntArg (" -checklevel" , DEFAULT_CHECKLEVEL),
1518+ args.GetIntArg (" -checkblocks" , DEFAULT_CHECKBLOCKS))) {
15191519 strLoadError = _ (" Corrupted block database detected" );
15201520 failed_verification = true ;
15211521 break ;
@@ -1707,11 +1707,11 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
17071707 connOptions.uiInterface = &uiInterface;
17081708 connOptions.m_banman = node.banman .get ();
17091709 connOptions.m_msgproc = node.peerman .get ();
1710- connOptions.nSendBufferMaxSize = 1000 * args.GetArg (" -maxsendbuffer" , DEFAULT_MAXSENDBUFFER);
1711- connOptions.nReceiveFloodSize = 1000 * args.GetArg (" -maxreceivebuffer" , DEFAULT_MAXRECEIVEBUFFER);
1710+ connOptions.nSendBufferMaxSize = 1000 * args.GetIntArg (" -maxsendbuffer" , DEFAULT_MAXSENDBUFFER);
1711+ connOptions.nReceiveFloodSize = 1000 * args.GetIntArg (" -maxreceivebuffer" , DEFAULT_MAXRECEIVEBUFFER);
17121712 connOptions.m_added_nodes = args.GetArgs (" -addnode" );
17131713
1714- connOptions.nMaxOutboundLimit = 1024 * 1024 * args.GetArg (" -maxuploadtarget" , DEFAULT_MAX_UPLOAD_TARGET);
1714+ connOptions.nMaxOutboundLimit = 1024 * 1024 * args.GetIntArg (" -maxuploadtarget" , DEFAULT_MAX_UPLOAD_TARGET);
17151715 connOptions.m_peer_connect_timeout = peer_connect_timeout;
17161716
17171717 for (const std::string& bind_arg : args.GetArgs (" -bind" )) {
0 commit comments