diff options
author | Jon Atack <jon@atack.com> | 2021-04-04 16:20:47 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2021-04-09 09:02:07 +0200 |
commit | 5056a37624b64588b277419f7ed8c325477a8ec7 (patch) | |
tree | a0e87ea057a6addf87dcb0782c2f6f4d0c298c63 | |
parent | db4d2c282afd46709792aaf2d36ffbfc1745b776 (diff) |
cli: add -addrinfo command
-rw-r--r-- | src/bitcoin-cli.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 3b0caef39a..2f7e49eccb 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -60,6 +60,7 @@ static void SetupCliArgs(ArgsManager& argsman) argsman.AddArg("-conf=<file>", strprintf("Specify configuration file. Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-datadir=<dir>", "Specify data directory", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-generate", strprintf("Generate blocks immediately, equivalent to RPC getnewaddress followed by RPC generatetoaddress. Optional positional integer arguments are number of blocks to generate (default: %s) and maximum iterations to try (default: %s), equivalent to RPC generatetoaddress nblocks and maxtries arguments. Example: bitcoin-cli -generate 4 1000", DEFAULT_NBLOCKS, DEFAULT_MAX_TRIES), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); + argsman.AddArg("-addrinfo", "Get the number of addresses known to the node, per network and total.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-getinfo", "Get general information from the remote server. Note that unlike server-side RPC calls, the results of -getinfo is the result of 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)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-netinfo", "Get network peer connection information from the remote server. An optional integer argument from 0 to 4 can be passed for different peers listings (default: 0). Pass \"help\" for detailed help documentation.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); @@ -964,6 +965,8 @@ static int CommandLineRPC(int argc, char *argv[]) } else { ParseError(error, strPrint, nRet); } + } else if (gArgs.GetBoolArg("-addrinfo", false)) { + rh.reset(new AddrinfoRequestHandler()); } else { rh.reset(new DefaultRequestHandler()); if (args.size() < 1) { |