rpc: disallow boolean verbosity in getorphantxs

Updates ParseVerbosity() to support disallowing
boolean verbosity.  Removes boolean verbosity
for getorphantxs to encourage integer verbosity
usage
This commit is contained in:
tdb3
2024-10-25 12:01:44 -04:00
parent 63f5e6ec79
commit 698f302df8
6 changed files with 12 additions and 8 deletions

View File

@@ -103,11 +103,13 @@ std::vector<unsigned char> ParseHexO(const UniValue& o, std::string_view strKey)
/**
* Parses verbosity from provided UniValue.
*
* @param[in] arg The verbosity argument as a bool (true) or int (0, 1, 2,...)
* @param[in] arg The verbosity argument as an int (0, 1, 2,...) or bool if allow_bool is set to true
* @param[in] default_verbosity The value to return if verbosity argument is null
* @param[in] allow_bool If true, allows arg to be a bool and parses it
* @returns An integer describing the verbosity level (e.g. 0, 1, 2, etc.)
* @throws JSONRPCError if allow_bool is false but arg provided is boolean
*/
int ParseVerbosity(const UniValue& arg, int default_verbosity);
int ParseVerbosity(const UniValue& arg, int default_verbosity, bool allow_bool);
/**
* Validate and return a CAmount from a UniValue number or string.