aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-12-17 19:52:36 +0100
committerMarcoFalke <falke.marco@gmail.com>2020-12-17 20:36:41 +0100
commitfae32f295cc5b57c1cb95090bb60cddb42f9778a (patch)
treed6edaf77832fd3bd15e371982eb55cff16963903 /src
parentfaf8f61368696b9cbbea55ead30d6a48203235ff (diff)
wallet: Add missing check for -descriptors wallet tool option
Diffstat (limited to 'src')
-rw-r--r--src/bitcoin-wallet.cpp2
-rw-r--r--src/wallet/wallettool.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/bitcoin-wallet.cpp b/src/bitcoin-wallet.cpp
index ef26ed3b95..3e8e5fc7bc 100644
--- a/src/bitcoin-wallet.cpp
+++ b/src/bitcoin-wallet.cpp
@@ -29,7 +29,7 @@ static void SetupWalletToolArgs(ArgsManager& argsman)
argsman.AddArg("-wallet=<wallet-name>", "Specify wallet name", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::OPTIONS);
argsman.AddArg("-dumpfile=<file name>", "When used with 'dump', writes out the records to this file. When used with 'createfromdump', loads the records into a new wallet.", ArgsManager::ALLOW_STRING, OptionsCategory::OPTIONS);
argsman.AddArg("-debug=<category>", "Output debugging information (default: 0).", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
- argsman.AddArg("-descriptors", "Create descriptors wallet. Only for create", ArgsManager::ALLOW_BOOL, OptionsCategory::OPTIONS);
+ argsman.AddArg("-descriptors", "Create descriptors wallet. Only for 'create'", ArgsManager::ALLOW_BOOL, OptionsCategory::OPTIONS);
argsman.AddArg("-format=<format>", "The format of the wallet file to create. Either \"bdb\" or \"sqlite\". Only used with 'createfromdump'", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-printtoconsole", "Send trace/debug info to console (default: 1 when no -debug is true, 0 otherwise).", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
diff --git a/src/wallet/wallettool.cpp b/src/wallet/wallettool.cpp
index e16d7f6338..a1bb7343f4 100644
--- a/src/wallet/wallettool.cpp
+++ b/src/wallet/wallettool.cpp
@@ -107,16 +107,18 @@ bool ExecuteWalletToolFunc(const ArgsManager& args, const std::string& command,
{
fs::path path = fs::absolute(name, GetWalletDir());
- // -format is only allowed with createfromdump. Disallow it for all other commands.
if (args.IsArgSet("-format") && command != "createfromdump") {
tfm::format(std::cerr, "The -format option can only be used with the \"createfromdump\" command.\n");
return false;
}
- // -dumpfile is only allowed with dump and createfromdump. Disallow it for all other commands.
if (args.IsArgSet("-dumpfile") && command != "dump" && command != "createfromdump") {
tfm::format(std::cerr, "The -dumpfile option can only be used with the \"dump\" and \"createfromdump\" commands.\n");
return false;
}
+ if (args.IsArgSet("-descriptors") && command != "create") {
+ tfm::format(std::cerr, "The -descriptors option can only be used with the 'create' command.\n");
+ return false;
+ }
if (command == "create") {
DatabaseOptions options;