Skip to content

Commit 5b82aa7

Browse files
committed
Fix bitcoin-cli --version
By declaring the relevant option. Note contrib/devtools/gen-manpages.sh relies on this version information.
1 parent 2dc5ab6 commit 5b82aa7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/bitcoin-cli.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ static void SetupCliArgs()
3535
const auto testnetBaseParams = CreateBaseChainParams(CBaseChainParams::TESTNET);
3636

3737
gArgs.AddArg("-?", "This help message", false, OptionsCategory::OPTIONS);
38+
gArgs.AddArg("-version", "Print version and exit", false, OptionsCategory::OPTIONS);
3839
gArgs.AddArg("-conf=<file>", strprintf("Specify configuration file. Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), false, OptionsCategory::OPTIONS);
3940
gArgs.AddArg("-datadir=<dir>", "Specify data directory", false, OptionsCategory::OPTIONS);
4041
gArgs.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)", false, OptionsCategory::OPTIONS);

test/functional/interface_bitcoin_cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ def set_test_params(self):
1515
def run_test(self):
1616
"""Main test logic"""
1717

18+
cli_response = self.nodes[0].cli("-version").send_cli()
19+
assert("Bitcoin Core RPC client version" in cli_response)
20+
1821
self.log.info("Compare responses from gewalletinfo RPC and `bitcoin-cli getwalletinfo`")
1922
cli_response = self.nodes[0].cli.getwalletinfo()
2023
rpc_response = self.nodes[0].getwalletinfo()

0 commit comments

Comments
 (0)