diff --git a/src/bench/bench_bitcoin.cpp b/src/bench/bench_bitcoin.cpp --- a/src/bench/bench_bitcoin.cpp +++ b/src/bench/bench_bitcoin.cpp @@ -21,49 +21,51 @@ static const int64_t DEFAULT_PLOT_HEIGHT = 768; static void SetupBenchArgs() { - gArgs.AddArg("-?", "Print this help message and exit", false, - OptionsCategory::OPTIONS); + gArgs.AddArg("-?", "Print this help message and exit", + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-list", "List benchmarks without executing them. Can be combined " "with -scaling and -filter", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-evals=", strprintf("Number of measurement evaluations to perform. (default: %u)", DEFAULT_BENCH_EVALUATIONS), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-filter=", strprintf("Regular expression filter to select benchmark by " "name (default: %s)", DEFAULT_BENCH_FILTER), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-scaling=", strprintf("Scaling factor for benchmark's runtime (default: %u)", DEFAULT_BENCH_SCALING), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-printer=(console|plot)", strprintf("Choose printer format. console: print data to console. " "plot: Print results as HTML graph (default: %s)", DEFAULT_BENCH_PRINTER), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-plot-plotlyurl=", strprintf("URL to use for plotly.js (default: %s)", DEFAULT_PLOT_PLOTLYURL), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-plot-width=", strprintf("Plot width in pixel (default: %u)", DEFAULT_PLOT_WIDTH), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-plot-height=", strprintf("Plot height in pixel (default: %u)", DEFAULT_PLOT_HEIGHT), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); // Hidden - gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN); - gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); + gArgs.AddArg("-h", "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); + gArgs.AddArg("-help", "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); } int main(int argc, char **argv) { diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -40,16 +40,17 @@ const auto regtestBaseParams = CreateBaseChainParams(CBaseChainParams::REGTEST); - gArgs.AddArg("-?", "This help message", false, OptionsCategory::OPTIONS); - gArgs.AddArg("-version", "Print version and exit", false, + gArgs.AddArg("-?", "This help message", ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, + false, OptionsCategory::OPTIONS); gArgs.AddArg("-conf=", strprintf("Specify configuration file. Relative paths will be " "prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), - false, OptionsCategory::OPTIONS); - gArgs.AddArg("-datadir=", _("Specify data directory"), false, - OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-datadir=", _("Specify data directory"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-getinfo", "Get general information from the remote server. Note that unlike " @@ -57,60 +58,62 @@ "multiple non-atomic requests. Some entries in the result may " "represent results from different states (e.g. wallet balance may be " "as of a different block from the chain state reported)", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); SetupChainParamsBaseOptions(); gArgs.AddArg( "-named", strprintf("Pass named instead of positional arguments (default: %s)", DEFAULT_NAMED), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-rpcconnect=", strprintf("Send commands to node running on (default: %s)", DEFAULT_RPCCONNECT), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-rpccookiefile=", "Location of the auth cookie. Relative paths will be prefixed " "by a net-specific datadir location. (default: data dir)", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-rpcport=", strprintf("Connect to JSON-RPC on (default: %u, " "testnet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), - false, OptionsCategory::OPTIONS); - gArgs.AddArg("-rpcwait", "Wait for RPC server to start", false, - OptionsCategory::OPTIONS); - gArgs.AddArg("-rpcuser=", "Username for JSON-RPC connections", false, - OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-rpcwait", "Wait for RPC server to start", + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-rpcuser=", "Username for JSON-RPC connections", + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-rpcpassword=", "Password for JSON-RPC connections", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-rpcclienttimeout=", strprintf("Timeout in seconds during HTTP requests, or 0 for " "no timeout. (default: %d)", DEFAULT_HTTP_CLIENT_TIMEOUT), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-stdinrpcpass", strprintf("Read RPC password from standard input as a single " "line. When combined with -stdin, the first line " "from standard input is used for the RPC password."), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-stdin", "Read extra arguments from standard input, one per line until " "EOF/Ctrl-D (recommended for sensitive information such as " "passphrases)", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-rpcwallet=", "Send RPC for non-default wallet on RPC server (needs to exactly match " "corresponding -wallet option passed to bitcoind)", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); // Hidden - gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN); - gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); + gArgs.AddArg("-h", "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); + gArgs.AddArg("-help", "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); } /** libevent event log callback */ diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -35,47 +35,48 @@ const std::function G_TRANSLATION_FUN = nullptr; static void SetupBitcoinTxArgs() { - gArgs.AddArg("-?", "This help message", false, OptionsCategory::OPTIONS); - gArgs.AddArg("-create", "Create new, empty TX.", false, + gArgs.AddArg("-?", "This help message", ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); - gArgs.AddArg("-json", "Select JSON output", false, + gArgs.AddArg("-create", "Create new, empty TX.", ArgsManager::ALLOW_ANY, + false, OptionsCategory::OPTIONS); + gArgs.AddArg("-json", "Select JSON output", ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-txid", "Output only the hex-encoded transaction id of the resultant " "transaction.", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); SetupChainParamsBaseOptions(); - gArgs.AddArg("delin=N", "Delete input N from TX", false, - OptionsCategory::COMMANDS); - gArgs.AddArg("delout=N", "Delete output N from TX", false, - OptionsCategory::COMMANDS); - gArgs.AddArg("in=TXID:VOUT(:SEQUENCE_NUMBER)", "Add input to TX", false, - OptionsCategory::COMMANDS); - gArgs.AddArg("locktime=N", "Set TX lock time to N", false, - OptionsCategory::COMMANDS); - gArgs.AddArg("nversion=N", "Set TX version to N", false, - OptionsCategory::COMMANDS); - gArgs.AddArg("outaddr=VALUE:ADDRESS", "Add address-based output to TX", + gArgs.AddArg("delin=N", "Delete input N from TX", ArgsManager::ALLOW_ANY, + false, OptionsCategory::COMMANDS); + gArgs.AddArg("delout=N", "Delete output N from TX", ArgsManager::ALLOW_ANY, + false, OptionsCategory::COMMANDS); + gArgs.AddArg("in=TXID:VOUT(:SEQUENCE_NUMBER)", "Add input to TX", + ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); + gArgs.AddArg("locktime=N", "Set TX lock time to N", ArgsManager::ALLOW_ANY, + false, OptionsCategory::COMMANDS); + gArgs.AddArg("nversion=N", "Set TX version to N", ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); + gArgs.AddArg("outaddr=VALUE:ADDRESS", "Add address-based output to TX", + ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); gArgs.AddArg("outpubkey=VALUE:PUBKEY[:FLAGS]", "Add pay-to-pubkey output to TX. " "Optionally add the \"S\" flag to wrap the output in a " "pay-to-script-hash.", - false, OptionsCategory::COMMANDS); - gArgs.AddArg("outdata=[VALUE:]DATA", "Add data-based output to TX", false, - OptionsCategory::COMMANDS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); + gArgs.AddArg("outdata=[VALUE:]DATA", "Add data-based output to TX", + ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); gArgs.AddArg("outscript=VALUE:SCRIPT[:FLAGS]", "Add raw script output to TX. " "Optionally add the \"S\" flag to wrap the output in a " "pay-to-script-hash.", - false, OptionsCategory::COMMANDS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); gArgs.AddArg( "outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]", "Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = PUBKEYS. " "Optionally add the \"S\" flag to wrap the output in a " "pay-to-script-hash.", - false, OptionsCategory::COMMANDS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); gArgs.AddArg("sign=SIGHASH-FLAGS", "Add zero or more signatures to transaction. " "This command requires JSON registers:" @@ -83,18 +84,20 @@ "privatekeys=JSON object. " "See signrawtransactionwithkey docs for format of sighash " "flags, JSON objects.", - false, OptionsCategory::COMMANDS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); - gArgs.AddArg("load=NAME:FILENAME", - "Load JSON file FILENAME into register NAME", false, - OptionsCategory::REGISTER_COMMANDS); - gArgs.AddArg("set=NAME:JSON-STRING", - "Set register NAME to given JSON-STRING", false, - OptionsCategory::REGISTER_COMMANDS); + gArgs.AddArg( + "load=NAME:FILENAME", "Load JSON file FILENAME into register NAME", + ArgsManager::ALLOW_ANY, false, OptionsCategory::REGISTER_COMMANDS); + gArgs.AddArg( + "set=NAME:JSON-STRING", "Set register NAME to given JSON-STRING", + ArgsManager::ALLOW_ANY, false, OptionsCategory::REGISTER_COMMANDS); // Hidden - gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN); - gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); + gArgs.AddArg("-h", "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); + gArgs.AddArg("-help", "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); } // diff --git a/src/bitcoin-wallet.cpp b/src/bitcoin-wallet.cpp --- a/src/bitcoin-wallet.cpp +++ b/src/bitcoin-wallet.cpp @@ -21,26 +21,30 @@ static void SetupWalletToolArgs() { SetupChainParamsBaseOptions(); - gArgs.AddArg("-?", "This help message", false, OptionsCategory::OPTIONS); - gArgs.AddArg("-datadir=", "Specify data directory", false, - OptionsCategory::OPTIONS); - gArgs.AddArg("-wallet=", "Specify wallet name", false, + gArgs.AddArg("-?", "This help message", ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-datadir=", "Specify data directory", + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-wallet=", "Specify wallet name", + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-debug=", - "Output debugging information (default: 0).", false, - OptionsCategory::DEBUG_TEST); + "Output debugging information (default: 0).", + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-printtoconsole", "Send trace/debug info to console (default: 1 when no -debug " "is true, 0 otherwise.", - false, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); - gArgs.AddArg("info", "Get wallet info", false, OptionsCategory::COMMANDS); - gArgs.AddArg("create", "Create new wallet file", false, + gArgs.AddArg("info", "Get wallet info", ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); + gArgs.AddArg("create", "Create new wallet file", ArgsManager::ALLOW_ANY, + false, OptionsCategory::COMMANDS); // Hidden - gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN); - gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); + gArgs.AddArg("-h", "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); + gArgs.AddArg("-help", "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); } static bool WalletAppInit(int argc, char *argv[]) { diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -20,9 +20,9 @@ "Enter regression test mode, which uses a special chain in " "which blocks can be solved instantly. This is intended for " "regression testing tools and app development.", - true, OptionsCategory::CHAINPARAMS); - gArgs.AddArg("-testnet", "Use the test chain", false, - OptionsCategory::CHAINPARAMS); + ArgsManager::ALLOW_ANY, true, OptionsCategory::CHAINPARAMS); + gArgs.AddArg("-testnet", "Use the test chain", ArgsManager::ALLOW_ANY, + false, OptionsCategory::CHAINPARAMS); } static std::unique_ptr globalChainBaseParams; diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -394,14 +394,14 @@ // alphabetical ordering. Do not translate _(...) -help-debug options, Many // technical terms, and only a very small audience, so is unnecessary stress // to translators. - gArgs.AddArg("-?", "Print this help message and exit", false, - OptionsCategory::OPTIONS); - gArgs.AddArg("-version", "Print version and exit", false, - OptionsCategory::OPTIONS); + gArgs.AddArg("-?", "Print this help message and exit", + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, + false, OptionsCategory::OPTIONS); gArgs.AddArg("-alertnotify=", "Execute command when a relevant alert is received or we see " "a really long fork (%s in cmd is replaced by message)", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-assumevalid=", strprintf( @@ -410,88 +410,88 @@ "verify all, default: %s, testnet: %s)", defaultChainParams->GetConsensus().defaultAssumeValid.GetHex(), testnetChainParams->GetConsensus().defaultAssumeValid.GetHex()), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-blocksdir=", "Specify directory to hold blocks subdirectory for *.dat " "files (default: )", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-blocknotify=", "Execute command when the best block changes (%s in cmd is " "replaced by block hash)", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-blockreconstructionextratxn=", strprintf("Extra transactions to keep in memory for compact " "block reconstructions (default: %u)", DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-blocksonly", strprintf("Whether to operate in a blocks only mode (default: %d)", DEFAULT_BLOCKSONLY), - true, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, true, OptionsCategory::OPTIONS); gArgs.AddArg("-conf=", strprintf("Specify configuration file. Relative paths will be " "prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), - false, OptionsCategory::OPTIONS); - gArgs.AddArg("-datadir=", "Specify data directory", false, - OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-datadir=", "Specify data directory", + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-dbbatchsize", strprintf("Maximum database write batch size in bytes (default: %u)", nDefaultDbBatchSize), - true, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, true, OptionsCategory::OPTIONS); gArgs.AddArg( "-dbcache=", strprintf( "Set database cache size in megabytes (%d to %d, default: %d)", nMinDbCache, nMaxDbCache, nDefaultDbCache), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-debuglogfile=", strprintf("Specify location of debug log file. Relative paths " "will be prefixed by a net-specific datadir " "location. (0 to disable; default: %s)", DEFAULT_DEBUGLOGFILE), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-feefilter", strprintf("Tell other nodes to filter invs to us by our " "mempool min fee (default: %d)", DEFAULT_FEEFILTER), - true, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, true, OptionsCategory::OPTIONS); gArgs.AddArg("-finalizationdelay=", strprintf("Set the minimum amount of time to wait between a " "block header reception and the block finalization. " "Unit is seconds (default: %d)", DEFAULT_MIN_FINALIZATION_DELAY), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-includeconf=", "Specify additional configuration file, relative to the -datadir path " "(only useable from configuration file, not command line)", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-maxreorgdepth=", strprintf("Configure at what depth blocks are considered " "final (default: %d). Use -1 to disable.", DEFAULT_MAX_REORG_DEPTH), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-loadblock=", "Imports blocks from external blk000??.dat file on startup", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-maxmempool=", strprintf("Keep the transaction memory pool below " "megabytes (default: %u)", DEFAULT_MAX_MEMPOOL_SIZE), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-maxorphantx=", strprintf("Keep at most unconnectable transactions in " "memory (default: %u)", DEFAULT_MAX_ORPHAN_TRANSACTIONS), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-mempoolexpiry=", strprintf("Do not keep transactions in the mempool longer " "than hours (default: %u)", DEFAULT_MEMPOOL_EXPIRY), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-minimumchainwork=", strprintf( @@ -499,24 +499,24 @@ "(default: %s, testnet: %s)", defaultChainParams->GetConsensus().nMinimumChainWork.GetHex(), testnetChainParams->GetConsensus().nMinimumChainWork.GetHex()), - true, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, true, OptionsCategory::OPTIONS); gArgs.AddArg( "-par=", strprintf("Set the number of script verification threads (%u to %d, 0 " "= auto, <0 = leave that many cores free, default: %d)", -GetNumCores(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-persistmempool", strprintf("Whether to save the mempool on shutdown and load " "on restart (default: %u)", DEFAULT_PERSIST_MEMPOOL), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-pid=", strprintf("Specify pid file. Relative paths will be prefixed " "by a net-specific datadir location. (default: %s)", BITCOIN_PID_FILENAME), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-prune=", strprintf("Reduce storage requirements by enabling pruning (deleting) " @@ -529,22 +529,22 @@ "= allow manual pruning via RPC, >=%u = automatically prune " "block files to stay under the specified target size in MiB)", MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks. When " "in pruning mode or if blocks on disk might be corrupted, use " "full -reindex instead.", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg( "-reindex", "Rebuild chain state and block index from the blk*.dat files on disk", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); #ifndef WIN32 gArgs.AddArg( "-sysperms", "Create new files with system default permissions, instead of umask " "077 (only effective with disabled wallet functionality)", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); #else hidden_args.emplace_back("-sysperms"); #endif @@ -552,152 +552,152 @@ strprintf("Maintain a full transaction index, used by the " "getrawtransaction rpc call (default: %d)", DEFAULT_TXINDEX), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-usecashaddr", "Use Cash Address for destination encoding instead of base58 " "(activate by default on Jan, 14)", - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-addnode=", "Add a node to connect to and attempt to keep the connection " "open (see the `addnode` RPC command help for more info)", - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg( "-banscore=", strprintf("Threshold for disconnecting misbehaving peers (default: %u)", DEFAULT_BANSCORE_THRESHOLD), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-bantime=", strprintf("Number of seconds to keep misbehaving peers from " "reconnecting (default: %u)", DEFAULT_MISBEHAVING_BANTIME), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-bind=", "Bind to given address and always listen on it. Use " "[host]:port notation for IPv6", - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg( "-connect=", "Connect only to the specified node(s); -connect=0 disables automatic " "connections (the rules for this peer are the same as for -addnode)", - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-discover", "Discover own IP addresses (default: 1 when listening and no " "-externalip or -proxy)", - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-dns", strprintf("Allow DNS lookups for -addnode, -seednode and " "-connect (default: %d)", DEFAULT_NAME_LOOKUP), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-dnsseed", "Query for peer addresses via DNS lookup, if low on addresses " "(default: 1 unless -connect used)", - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-enablebip61", strprintf("Send reject messages per BIP61 (default: %u)", DEFAULT_ENABLE_BIP61), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); - gArgs.AddArg("-externalip=", "Specify your own public address", false, - OptionsCategory::CONNECTION); + gArgs.AddArg("-externalip=", "Specify your own public address", + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg( "-forcednsseed", strprintf( "Always query for peer addresses via DNS lookup (default: %d)", DEFAULT_FORCEDNSSEED), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg( "-listen", "Accept connections from outside (default: 1 if no -proxy or -connect)", - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg( "-listenonion", strprintf("Automatically create Tor hidden service (default: %d)", DEFAULT_LISTEN_ONION), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg( "-maxconnections=", strprintf("Maintain at most connections to peers (default: %u)", DEFAULT_MAX_PEER_CONNECTIONS), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-maxreceivebuffer=", strprintf("Maximum per-connection receive buffer, *1000 " "bytes (default: %u)", DEFAULT_MAXRECEIVEBUFFER), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg( "-maxsendbuffer=", strprintf( "Maximum per-connection send buffer, *1000 bytes (default: %u)", DEFAULT_MAXSENDBUFFER), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg( "-maxtimeadjustment", strprintf("Maximum allowed median peer time offset adjustment. Local " "perspective of time may be influenced by peers forward or " "backward by this amount. (default: %u seconds)", DEFAULT_MAX_TIME_ADJUSTMENT), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-onion=", strprintf("Use separate SOCKS5 proxy to reach peers via Tor " "hidden services (default: %s)", "-proxy"), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-onlynet=", "Only connect to nodes in network (ipv4, ipv6 or onion)", - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-peerbloomfilters", strprintf("Support filtering of blocks and transaction with " "bloom filters (default: %d)", DEFAULT_PEERBLOOMFILTERS), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-permitbaremultisig", strprintf("Relay non-P2SH multisig (default: %d)", DEFAULT_PERMIT_BAREMULTISIG), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-port=", strprintf("Listen for connections on (default: %u, " "testnet: %u, regtest: %u)", defaultChainParams->GetDefaultPort(), testnetChainParams->GetDefaultPort(), regtestChainParams->GetDefaultPort()), - false, OptionsCategory::CONNECTION); - gArgs.AddArg("-proxy=", _("Connect through SOCKS5 proxy"), false, - OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); + gArgs.AddArg("-proxy=", _("Connect through SOCKS5 proxy"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-proxyrandomize", strprintf("Randomize credentials for every proxy connection. " "This enables Tor stream isolation (default: %d)", DEFAULT_PROXYRANDOMIZE), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-seednode=", "Connect to a node to retrieve peer addresses, and disconnect", - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-timeout=", strprintf("Specify connection timeout in milliseconds " "(minimum: 1, default: %d)", DEFAULT_CONNECT_TIMEOUT), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg( "-torcontrol=:", strprintf( "Tor control port to use if onion listening enabled (default: %s)", DEFAULT_TOR_CONTROL), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-torpassword=", - "Tor control port password (default: empty)", false, - OptionsCategory::CONNECTION); + "Tor control port password (default: empty)", + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); #ifdef USE_UPNP #if USE_UPNP gArgs.AddArg("-upnp", "Use UPnP to map the listening port (default: 1 when " "listening and no -proxy)", - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); #else gArgs.AddArg( "-upnp", - strprintf("Use UPnP to map the listening port (default: %u)", 0), false, - OptionsCategory::CONNECTION); + strprintf("Use UPnP to map the listening port (default: %u)", 0), + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); #endif #else hidden_args.emplace_back("-upnp"); @@ -705,7 +705,7 @@ gArgs.AddArg("-whitebind=", "Bind to given address and whitelist peers connecting to it. " "Use [host]:port notation for IPv6", - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-whitelist=", "Whitelist peers connecting from the given IP address (e.g. " "1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be " @@ -713,29 +713,29 @@ "Whitelisted peers cannot be DoS banned and their " "transactions are always relayed, even if they are already in " "the mempool, useful e.g. for a gateway", - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg( "-maxuploadtarget=", strprintf("Tries to keep outbound traffic under the given target (in " "MiB per 24h), 0 = no limit (default: %d)", DEFAULT_MAX_UPLOAD_TARGET), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); g_wallet_init_interface.AddWalletOptions(); #if ENABLE_ZMQ gArgs.AddArg("-zmqpubhashblock=
", - "Enable publish hash block in
", false, - OptionsCategory::ZMQ); + "Enable publish hash block in
", + ArgsManager::ALLOW_ANY, false, OptionsCategory::ZMQ); gArgs.AddArg("-zmqpubhashtx=
", - "Enable publish hash transaction in
", false, - OptionsCategory::ZMQ); + "Enable publish hash transaction in
", + ArgsManager::ALLOW_ANY, false, OptionsCategory::ZMQ); gArgs.AddArg("-zmqpubrawblock=
", - "Enable publish raw block in
", false, - OptionsCategory::ZMQ); + "Enable publish raw block in
", + ArgsManager::ALLOW_ANY, false, OptionsCategory::ZMQ); gArgs.AddArg("-zmqpubrawtx=
", - "Enable publish raw transaction in
", false, - OptionsCategory::ZMQ); + "Enable publish raw transaction in
", + ArgsManager::ALLOW_ANY, false, OptionsCategory::ZMQ); #else hidden_args.emplace_back("-zmqpubhashblock=
"); hidden_args.emplace_back("-zmqpubhashtx=
"); @@ -747,7 +747,7 @@ "-checkblocks=", strprintf("How many blocks to check at startup (default: %u, 0 = all)", DEFAULT_CHECKBLOCKS), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-checklevel=", strprintf("How thorough the block verification of " @@ -760,7 +760,7 @@ "Each level includes the checks of the previous levels " "(0-4, default: %u)", DEFAULT_CHECKLEVEL), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-checkblockindex", strprintf("Do a full consistency check for mapBlockIndex, " @@ -768,63 +768,63 @@ "mapBlocksUnlinked occasionally. (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-checkmempool=", strprintf( "Run checks every transactions (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-checkpoints", strprintf("Only accept block chain matching built-in " "checkpoints (default: %d)", DEFAULT_CHECKPOINTS_ENABLED), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-deprecatedrpc=", - "Allows deprecated RPC method(s) to be used", true, - OptionsCategory::DEBUG_TEST); + "Allows deprecated RPC method(s) to be used", + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-dropmessagestest=", - "Randomly drop 1 of every network messages", true, - OptionsCategory::DEBUG_TEST); + "Randomly drop 1 of every network messages", + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-stopafterblockimport", strprintf("Stop running after importing blocks from disk (default: %d)", DEFAULT_STOPAFTERBLOCKIMPORT), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-stopatheight", strprintf("Stop running after reaching the given height in " "the main chain (default: %u)", DEFAULT_STOPATHEIGHT), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-limitancestorcount=", strprintf("Do not accept transactions if number of in-mempool " "ancestors is or more (pre-phonon-upgrade " "default: %u, post-phonon-upgrade default: %u)", DEFAULT_ANCESTOR_LIMIT, DEFAULT_ANCESTOR_LIMIT_LONGER), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-limitancestorsize=", strprintf("Do not accept transactions whose size with all in-mempool " "ancestors exceeds kilobytes (default: %u)", DEFAULT_ANCESTOR_SIZE_LIMIT), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-limitdescendantcount=", strprintf("Do not accept transactions if any ancestor would have " "or more in-mempool descendants (default pre-phonon-upgrade: " "%u, default post-phonon-upgrade: %u)", DEFAULT_DESCENDANT_LIMIT, DEFAULT_DESCENDANT_LIMIT_LONGER), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-limitdescendantsize=", strprintf("Do not accept transactions if any ancestor would have more " "than kilobytes of in-mempool descendants (default: %u).", DEFAULT_DESCENDANT_SIZE_LIMIT), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-addrmantest", "Allows to test address relay on localhost", - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-debug=", strprintf("Output debugging information (default: %u, " @@ -835,73 +835,73 @@ "output all debugging information." " can be: " + ListLogCategories() + ".", - false, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-debugexclude=", strprintf("Exclude debugging information for a category. Can be used " "in conjunction with -debug=1 to output debug logs for all " "categories except one or more specified categories."), - false, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-help-debug", - "Print help message with debugging options and exit", false, - OptionsCategory::DEBUG_TEST); + "Print help message with debugging options and exit", + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-logips", strprintf("Include IP addresses in debug output (default: %d)", DEFAULT_LOGIPS), - false, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-logtimestamps", strprintf("Prepend debug output with timestamp (default: %d)", DEFAULT_LOGTIMESTAMPS), - false, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-logthreadnames", strprintf( "Prepend debug output with name of the originating thread (only " "available on platforms supporting thread_local) (default: %u)", DEFAULT_LOGTHREADNAMES), - false, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-logtimemicros", strprintf("Add microsecond precision to debug timestamps (default: %d)", DEFAULT_LOGTIMEMICROS), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-mocktime=", - "Replace actual time with seconds since epoch (default: 0)", true, - OptionsCategory::DEBUG_TEST); + "Replace actual time with seconds since epoch (default: 0)", + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-maxsigcachesize=", strprintf("Limit size of signature cache to MiB (default: %u)", DEFAULT_MAX_SIG_CACHE_SIZE), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-maxscriptcachesize=", strprintf("Limit size of script cache to MiB (default: %u)", DEFAULT_MAX_SCRIPT_CACHE_SIZE), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-maxtipage=", strprintf("Maximum tip age in seconds to consider node in " "initial block download (default: %u)", DEFAULT_MAX_TIP_AGE), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-printtoconsole", "Send trace/debug info to console instead of debug.log file (default: " "1 when no -daemon. To disable logging to file, set debuglogfile=0)", - false, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-printpriority", strprintf("Log transaction priority and fee per kB when " "mining blocks (default: %d)", DEFAULT_PRINTPRIORITY), - true, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::DEBUG_TEST); gArgs.AddArg( "-shrinkdebugfile", "Shrink debug.log file on client startup (default: 1 when no -debug)", - false, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-uacomment=", "Append comment to the user agent string", - false, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); SetupChainParamsBaseOptions(); @@ -910,53 +910,53 @@ strprintf( "Relay and mine \"non-standard\" transactions (%sdefault: %u)", "testnet/regtest only; ", defaultChainParams->RequireStandard()), - true, OptionsCategory::NODE_RELAY); + ArgsManager::ALLOW_ANY, true, OptionsCategory::NODE_RELAY); gArgs.AddArg("-excessiveblocksize=", strprintf("Do not accept blocks larger than this limit, in " "bytes (default: %d)", DEFAULT_MAX_BLOCK_SIZE), - true, OptionsCategory::NODE_RELAY); + ArgsManager::ALLOW_ANY, true, OptionsCategory::NODE_RELAY); gArgs.AddArg( "-dustrelayfee=", strprintf("Fee rate (in %s/kB) used to defined dust, the value of an " "output such that it will cost about 1/3 of its value in " "fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)), - true, OptionsCategory::NODE_RELAY); + ArgsManager::ALLOW_ANY, true, OptionsCategory::NODE_RELAY); gArgs.AddArg("-bytespersigop", strprintf("Equivalent bytes per sigop in transactions for " "relay and mining (default: %u)", DEFAULT_BYTES_PER_SIGOP), - false, OptionsCategory::NODE_RELAY); + ArgsManager::ALLOW_ANY, false, OptionsCategory::NODE_RELAY); gArgs.AddArg( "-datacarrier", strprintf("Relay and mine data carrier transactions (default: %d)", DEFAULT_ACCEPT_DATACARRIER), - false, OptionsCategory::NODE_RELAY); + ArgsManager::ALLOW_ANY, false, OptionsCategory::NODE_RELAY); gArgs.AddArg("-datacarriersize", strprintf("Maximum size of data in data carrier transactions " "we relay and mine (default: %u)", MAX_OP_RETURN_RELAY), - false, OptionsCategory::NODE_RELAY); + ArgsManager::ALLOW_ANY, false, OptionsCategory::NODE_RELAY); gArgs.AddArg( "-minrelaytxfee=", strprintf("Fees (in %s/kB) smaller than this are rejected for " "relaying, mining and transaction creation (default: %s)", CURRENCY_UNIT, FormatMoney(DEFAULT_MIN_RELAY_TX_FEE_PER_KB)), - false, OptionsCategory::NODE_RELAY); + ArgsManager::ALLOW_ANY, false, OptionsCategory::NODE_RELAY); gArgs.AddArg( "-whitelistrelay", strprintf(_("Accept relayed transactions received from whitelisted " "peers even when not relaying transactions (default: %d)"), DEFAULT_WHITELISTRELAY), - false, OptionsCategory::NODE_RELAY); + ArgsManager::ALLOW_ANY, false, OptionsCategory::NODE_RELAY); gArgs.AddArg( "-whitelistforcerelay", strprintf("Force relay of transactions from whitelisted peers even if " "they violate local relay policy (default: %d)", DEFAULT_WHITELISTFORCERELAY), - false, OptionsCategory::NODE_RELAY); + ArgsManager::ALLOW_ANY, false, OptionsCategory::NODE_RELAY); // Not sure this really belongs here, but it will do for now. // FIXME: This doesn't work anyways. @@ -964,29 +964,30 @@ strprintf("Fees (in %s/kB) to charge per utxo created for " "relaying, and mining (default: %s)", CURRENCY_UNIT, FormatMoney(DEFAULT_UTXO_FEE)), - true, OptionsCategory::NODE_RELAY); + ArgsManager::ALLOW_ANY, true, OptionsCategory::NODE_RELAY); gArgs.AddArg("-blockmaxsize=", strprintf("Set maximum block size in bytes (default: %d)", DEFAULT_MAX_GENERATED_BLOCK_SIZE), - false, OptionsCategory::BLOCK_CREATION); - gArgs.AddArg("-blockmintxfee=", - strprintf("Set lowest fee rate (in %s/kB) for transactions to " - "be included in block creation. (default: %s)", - CURRENCY_UNIT, - FormatMoney(DEFAULT_BLOCK_MIN_TX_FEE_PER_KB)), - false, OptionsCategory::BLOCK_CREATION); + ArgsManager::ALLOW_ANY, false, + OptionsCategory::BLOCK_CREATION); + gArgs.AddArg( + "-blockmintxfee=", + strprintf("Set lowest fee rate (in %s/kB) for transactions to " + "be included in block creation. (default: %s)", + CURRENCY_UNIT, FormatMoney(DEFAULT_BLOCK_MIN_TX_FEE_PER_KB)), + ArgsManager::ALLOW_ANY, false, OptionsCategory::BLOCK_CREATION); gArgs.AddArg("-blockversion=", - "Override block version to test forking scenarios", true, - OptionsCategory::BLOCK_CREATION); + "Override block version to test forking scenarios", + ArgsManager::ALLOW_ANY, true, OptionsCategory::BLOCK_CREATION); - gArgs.AddArg("-server", "Accept command line and JSON-RPC commands", false, - OptionsCategory::RPC); + gArgs.AddArg("-server", "Accept command line and JSON-RPC commands", + ArgsManager::ALLOW_ANY, false, OptionsCategory::RPC); gArgs.AddArg("-rest", strprintf("Accept public REST requests (default: %d)", DEFAULT_REST_ENABLE), - false, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, false, OptionsCategory::RPC); gArgs.AddArg( "-rpcbind=[:port]", "Bind to given address to listen for JSON-RPC connections. This option " @@ -995,15 +996,15 @@ "can be specified multiple times (default: 127.0.0.1 and ::1 i.e., " "localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., " "all addresses)", - false, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, false, OptionsCategory::RPC); gArgs.AddArg("-rpccookiefile=", "Location of the auth cookie. Relative paths will be prefixed " "by a net-specific datadir location. (default: data dir)", - false, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, false, OptionsCategory::RPC); gArgs.AddArg("-rpcuser=", _("Username for JSON-RPC connections"), - false, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, false, OptionsCategory::RPC); gArgs.AddArg("-rpcpassword=", _("Password for JSON-RPC connections"), - false, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, false, OptionsCategory::RPC); gArgs.AddArg( "-rpcauth=", "Username and hashed password for JSON-RPC connections. The field " @@ -1011,45 +1012,45 @@ "python script is included in share/rpcauth. The client then connects " "normally using the rpcuser=/rpcpassword= pair of " "arguments. This option can be specified multiple times", - false, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, false, OptionsCategory::RPC); gArgs.AddArg("-rpcport=", strprintf("Listen for JSON-RPC connections on " "(default: %u, testnet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), - false, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, false, OptionsCategory::RPC); gArgs.AddArg("-rpcallowip=", "Allow JSON-RPC connections from specified source. Valid for " " are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. " "1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). " "This option can be specified multiple times", - false, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, false, OptionsCategory::RPC); gArgs.AddArg( "-rpcthreads=", strprintf( "Set the number of threads to service RPC calls (default: %d)", DEFAULT_HTTP_THREADS), - false, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, false, OptionsCategory::RPC); gArgs.AddArg( "-rpccorsdomain=value", "Domain from which to accept cross origin requests (browser enforced)", - false, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, false, OptionsCategory::RPC); gArgs.AddArg("-rpcworkqueue=", strprintf("Set the depth of the work queue to service RPC " "calls (default: %d)", DEFAULT_HTTP_WORKQUEUE), - true, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, true, OptionsCategory::RPC); gArgs.AddArg("-rpcservertimeout=", strprintf("Timeout during HTTP requests (default: %d)", DEFAULT_HTTP_SERVER_TIMEOUT), - true, OptionsCategory::RPC); + ArgsManager::ALLOW_ANY, true, OptionsCategory::RPC); #if HAVE_DECL_DAEMON gArgs.AddArg("-daemon", _("Run in the background as a daemon and accept commands"), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); #else hidden_args.emplace_back("-daemon"); #endif @@ -1058,12 +1059,12 @@ gArgs.AddArg( "-enableavalanche", strprintf("Enable avalanche (default: %u)", AVALANCHE_DEFAULT_ENABLED), - false, OptionsCategory::AVALANCHE); + ArgsManager::ALLOW_ANY, false, OptionsCategory::AVALANCHE); gArgs.AddArg( "-avacooldown", strprintf("Mandatory cooldown between two avapoll (default: %u)", AVALANCHE_DEFAULT_COOLDOWN), - false, OptionsCategory::AVALANCHE); + ArgsManager::ALLOW_ANY, false, OptionsCategory::AVALANCHE); // Add the hidden options gArgs.AddHiddenArgs(hidden_args); diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -445,31 +445,32 @@ gArgs.AddArg("-allowselfsignedrootcertificates", strprintf("Allow self signed root certificates (default: %d)", DEFAULT_SELFSIGNED_ROOTCERTS), - true, OptionsCategory::GUI); + ArgsManager::ALLOW_ANY, true, OptionsCategory::GUI); #endif gArgs.AddArg("-choosedatadir", strprintf("Choose data directory on startup (default: %d)", DEFAULT_CHOOSE_DATADIR), - false, OptionsCategory::GUI); + ArgsManager::ALLOW_ANY, false, OptionsCategory::GUI); gArgs.AddArg("-lang=", "Set language, for example \"de_DE\" (default: system locale)", - false, OptionsCategory::GUI); - gArgs.AddArg("-min", "Start minimized", false, OptionsCategory::GUI); + ArgsManager::ALLOW_ANY, false, OptionsCategory::GUI); + gArgs.AddArg("-min", "Start minimized", ArgsManager::ALLOW_ANY, false, + OptionsCategory::GUI); gArgs.AddArg( "-rootcertificates=", "Set SSL root certificates for payment request (default: -system-)", - false, OptionsCategory::GUI); + ArgsManager::ALLOW_ANY, false, OptionsCategory::GUI); gArgs.AddArg("-splash", strprintf("Show splash screen on startup (default: %d)", DEFAULT_SPLASHSCREEN), - false, OptionsCategory::GUI); + ArgsManager::ALLOW_ANY, false, OptionsCategory::GUI); gArgs.AddArg("-resetguisettings", "Reset all settings changed in the GUI", - false, OptionsCategory::GUI); + ArgsManager::ALLOW_ANY, false, OptionsCategory::GUI); gArgs.AddArg("-uiplatform", strprintf("Select platform to customize UI for (one of " "windows, macosx, other; default: %s)", BitcoinGUI::DEFAULT_UIPLATFORM), - true, OptionsCategory::GUI); + ArgsManager::ALLOW_ANY, true, OptionsCategory::GUI); } #ifndef BITCOIN_QT_TEST diff --git a/src/rpc/test/server_tests.cpp b/src/rpc/test/server_tests.cpp --- a/src/rpc/test/server_tests.cpp +++ b/src/rpc/test/server_tests.cpp @@ -15,7 +15,8 @@ BOOST_AUTO_TEST_CASE(server_IsDeprecatedRPCEnabled) { ArgsManager testArgs; - testArgs.AddArg("-deprecatedrpc", "", false, OptionsCategory::OPTIONS); + testArgs.AddArg("-deprecatedrpc", "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::OPTIONS); const char *argv_test[] = {"bitcoind", "-deprecatedrpc=foo", "-deprecatedrpc=bar"}; diff --git a/src/seeder/main.cpp b/src/seeder/main.cpp --- a/src/seeder/main.cpp +++ b/src/seeder/main.cpp @@ -120,46 +120,54 @@ private: void SetupSeederArgs() { - gArgs.AddArg("-?", _("Print this help message and exit"), false, - OptionsCategory::OPTIONS); - gArgs.AddArg("-version", _("Print version and exit"), false, - OptionsCategory::OPTIONS); - gArgs.AddArg("-host=", _("Hostname of the DNS seed"), false, - OptionsCategory::OPTIONS); - gArgs.AddArg("-ns=", _("Hostname of the nameserver"), false, - OptionsCategory::OPTIONS); + gArgs.AddArg("-?", _("Print this help message and exit"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-version", _("Print version and exit"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-host=", _("Hostname of the DNS seed"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-ns=", _("Hostname of the nameserver"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-mbox=", - _("E-Mail address reported in SOA records"), false, - OptionsCategory::OPTIONS); + _("E-Mail address reported in SOA records"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-threads=", _("Number of crawlers to run in parallel (default 96)"), - false, OptionsCategory::OPTIONS); + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-dnsthreads=", - _("Number of DNS server threads (default 4)"), false, - OptionsCategory::OPTIONS); + _("Number of DNS server threads (default 4)"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); gArgs.AddArg("-port=", _("UDP port to listen on (default 53)"), - false, OptionsCategory::CONNECTION); - gArgs.AddArg("-onion=", _("Tor proxy IP/Port"), false, + ArgsManager::ALLOW_ANY, false, + OptionsCategory::CONNECTION); + gArgs.AddArg("-onion=", _("Tor proxy IP/Port"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg("-proxyipv4=", _("IPV4 SOCKS5 proxy IP/Port"), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, + OptionsCategory::CONNECTION); gArgs.AddArg("-proxyipv6=", _("IPV6 SOCKS5 proxy IP/Port"), - false, OptionsCategory::CONNECTION); + ArgsManager::ALLOW_ANY, false, + OptionsCategory::CONNECTION); gArgs.AddArg("-filter=", - _("Allow these flag combinations as filters"), false, - OptionsCategory::OPTIONS); - gArgs.AddArg("-wipeban", _("Wipe list of banned nodes"), false, + _("Allow these flag combinations as filters"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); + gArgs.AddArg("-wipeban", _("Wipe list of banned nodes"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); - gArgs.AddArg("-wipeignore", _("Wipe list of ignored nodes"), false, + gArgs.AddArg("-wipeignore", _("Wipe list of ignored nodes"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::CONNECTION); gArgs.AddArg( "-help-debug", - _("Show all debugging options (usage: --help -help-debug)"), false, - OptionsCategory::DEBUG_TEST); + _("Show all debugging options (usage: --help -help-debug)"), + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); SetupChainParamsBaseOptions(); - gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); - gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN); + gArgs.AddArg("-help", "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); + gArgs.AddArg("-h", "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); } }; diff --git a/src/test/getarg_tests.cpp b/src/test/getarg_tests.cpp --- a/src/test/getarg_tests.cpp +++ b/src/test/getarg_tests.cpp @@ -36,7 +36,8 @@ static void SetupArgs(ArgsManager &am, const std::vector &args) { for (const std::string &arg : args) { - am.AddArg(arg, "", false, OptionsCategory::OPTIONS); + am.AddArg(arg, "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::OPTIONS); } } diff --git a/src/test/main.cpp b/src/test/main.cpp --- a/src/test/main.cpp +++ b/src/test/main.cpp @@ -26,7 +26,8 @@ }; for (const auto &arg : testArgs) { - gArgs.AddArg(arg, "", false, OptionsCategory::HIDDEN); + gArgs.AddArg(arg, "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); } auto &master_test_suite = utf::master_test_suite(); diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -191,7 +191,8 @@ } void SetupArgs(int argv, const char *args[]) { for (int i = 0; i < argv; ++i) { - AddArg(args[i], "", false, OptionsCategory::OPTIONS); + AddArg(args[i], "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::OPTIONS); } } }; diff --git a/src/util/system.h b/src/util/system.h --- a/src/util/system.h +++ b/src/util/system.h @@ -297,7 +297,8 @@ * Add argument */ void AddArg(const std::string &name, const std::string &help, - const bool debug_only, const OptionsCategory &cat); + unsigned int flags, const bool debug_only, + const OptionsCategory &cat); // Remove an arg setting, used only in testing void ClearArg(const std::string &strArg); diff --git a/src/util/system.cpp b/src/util/system.cpp --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -627,7 +627,8 @@ } void ArgsManager::AddArg(const std::string &name, const std::string &help, - const bool debug_only, const OptionsCategory &cat) { + unsigned int flags, const bool debug_only, + const OptionsCategory &cat) { // Split arg name from its help param size_t eq_index = name.find('='); if (eq_index == std::string::npos) { @@ -646,7 +647,8 @@ void ArgsManager::AddHiddenArgs(const std::vector &names) { for (const std::string &name : names) { - AddArg(name, "", false, OptionsCategory::HIDDEN); + AddArg(name, "", ArgsManager::ALLOW_ANY, false, + OptionsCategory::HIDDEN); } } diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -45,57 +45,57 @@ "as suboptimal coin selection may result due to the added " "limitation (default: %u)", DEFAULT_AVOIDPARTIALSPENDS), - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg("-disablewallet", - "Do not load the wallet and disable wallet RPC calls", false, - OptionsCategory::WALLET); + "Do not load the wallet and disable wallet RPC calls", + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg("-fallbackfee=", strprintf("A fee rate (in %s/kB) that will be used when fee " "estimation has insufficient data (default: %s)", CURRENCY_UNIT, FormatMoney(DEFAULT_FALLBACK_FEE)), - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg("-keypool=", strprintf("Set key pool size to (default: %u)", DEFAULT_KEYPOOL_SIZE), - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg( "-maxtxfee=", strprintf("Maximum total fees (in %s) to use in a single wallet " "transaction or raw transaction; setting this too low may " "abort large transactions (default: %s)", CURRENCY_UNIT, FormatMoney(DEFAULT_TRANSACTION_MAXFEE)), - false, OptionsCategory::DEBUG_TEST); + ArgsManager::ALLOW_ANY, false, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-mintxfee=", strprintf("Fees (in %s/kB) smaller than this are considered " "zero fee for transaction creation (default: %s)", CURRENCY_UNIT, FormatMoney(DEFAULT_TRANSACTION_MINFEE_PER_KB)), - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg( "-paytxfee=", strprintf( "Fee (in %s/kB) to add to transactions you send (default: %s)", CURRENCY_UNIT, FormatMoney(CFeeRate{DEFAULT_PAY_TX_FEE}.GetFeePerK())), - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg( "-rescan", "Rescan the block chain for missing wallet transactions on startup", - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg( "-salvagewallet", "Attempt to recover private keys from a corrupt wallet on startup", - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg( "-spendzeroconfchange", strprintf( "Spend unconfirmed change when sending transactions (default: %d)", DEFAULT_SPEND_ZEROCONF_CHANGE), - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg("-upgradewallet", "Upgrade wallet to latest format on startup", - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg("-wallet=", "Specify wallet database path. Can be specified multiple " "times to load multiple wallets. Path is interpreted relative " @@ -103,47 +103,50 @@ "it does not exist (as a directory containing a wallet.dat " "file and log files). For backwards compatibility this will " "also accept names of existing data files in .)", - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg( "-walletbroadcast", strprintf("Make the wallet broadcast transactions (default: %d)", DEFAULT_WALLETBROADCAST), - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg("-walletdir=", "Specify directory to hold wallets (default: " "/wallets if it exists, otherwise )", - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg("-walletnotify=", "Execute command when a wallet transaction changes (%s in cmd " "is replaced by TxID)", - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg( "-zapwallettxes=", "Delete all wallet transactions and only recover those parts of the " "blockchain through -rescan on startup (1 = keep tx meta data e.g. " "payment request information, 2 = drop tx meta data)", - false, OptionsCategory::WALLET); + ArgsManager::ALLOW_ANY, false, OptionsCategory::WALLET); gArgs.AddArg("-dblogsize=", strprintf("Flush wallet database activity from memory to disk " "log every megabytes (default: %u)", DEFAULT_WALLET_DBLOGSIZE), - true, OptionsCategory::WALLET_DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, + OptionsCategory::WALLET_DEBUG_TEST); gArgs.AddArg( "-flushwallet", strprintf("Run a thread to flush wallet periodically (default: %d)", DEFAULT_FLUSHWALLET), - true, OptionsCategory::WALLET_DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, OptionsCategory::WALLET_DEBUG_TEST); gArgs.AddArg("-privdb", strprintf("Sets the DB_PRIVATE flag in the wallet db " "environment (default: %d)", DEFAULT_WALLET_PRIVDB), - true, OptionsCategory::WALLET_DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, + OptionsCategory::WALLET_DEBUG_TEST); gArgs.AddArg("-walletrejectlongchains", strprintf("Wallet will not create transactions that violate " "mempool chain limits (default: %d)", DEFAULT_WALLET_REJECT_LONG_CHAINS), - true, OptionsCategory::WALLET_DEBUG_TEST); + ArgsManager::ALLOW_ANY, true, + OptionsCategory::WALLET_DEBUG_TEST); } bool WalletInit::ParameterInteraction() const {