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

@@ -854,7 +854,7 @@ static RPCHelpMan getorphantxs()
"\nShows transactions in the tx orphanage.\n"
"\nEXPERIMENTAL warning: this call may be changed in future releases.\n",
{
{"verbosity|verbose", RPCArg::Type::NUM, RPCArg::Default{0}, "0 for an array of txids (may contain duplicates), 1 for an array of objects with tx details, and 2 for details from (1) and tx hex",
{"verbosity", RPCArg::Type::NUM, RPCArg::Default{0}, "0 for an array of txids (may contain duplicates), 1 for an array of objects with tx details, and 2 for details from (1) and tx hex",
RPCArgOptions{.skip_type_check = true}},
},
{
@@ -889,7 +889,7 @@ static RPCHelpMan getorphantxs()
PeerManager& peerman = EnsurePeerman(node);
std::vector<TxOrphanage::OrphanTxBase> orphanage = peerman.GetOrphanTransactions();
int verbosity{ParseVerbosity(request.params[0], /*default_verbosity=*/0)};
int verbosity{ParseVerbosity(request.params[0], /*default_verbosity=*/0, /*allow_bool*/false)};
UniValue ret(UniValue::VARR);