mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-25 13:28:35 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user