Skip to content

Commit

Permalink
Fixes type check on verbose parameter (#1344)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcorral authored Jun 16, 2022
1 parent 0beb92e commit a4c52b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/masternodes/rpc_vault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,11 @@ UniValue getvault(const JSONRPCRequest& request) {
RPCTypeCheck(request.params, {UniValue::VSTR}, false);
if (auto res = GetRPCResultCache().TryGet(request)) return *res;

bool verbose = request.params[1].getBool();
CVaultId vaultId = ParseHashV(request.params[0], "vaultId");
bool verbose{false};
if (request.params.size() > 1) {
verbose = request.params[1].get_bool();
}

LOCK(cs_main);

Expand Down Expand Up @@ -1836,7 +1839,7 @@ static const CRPCCommand commands[] =
{"vault", "createvault", &createvault, {"ownerAddress", "schemeId", "inputs"}},
{"vault", "closevault", &closevault, {"id", "returnAddress", "inputs"}},
{"vault", "listvaults", &listvaults, {"options", "pagination"}},
{"vault", "getvault", &getvault, {"id"}},
{"vault", "getvault", &getvault, {"id", "verbose"}},
{"vault", "listvaulthistory", &listvaulthistory, {"id", "options"}},
{"vault", "updatevault", &updatevault, {"id", "parameters", "inputs"}},
{"vault", "deposittovault", &deposittovault, {"id", "from", "amount", "inputs"}},
Expand Down
1 change: 1 addition & 0 deletions src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "listvaulthistory", 1, "options" },
{ "listvaults", 0, "options" },
{ "listvaults", 1, "pagination" },
{ "getvault", 1, "verbose" },
{ "listauctions", 0, "pagination" },
{ "listauctionhistory", 1, "pagination" },
{ "estimateloan", 1, "tokens" },
Expand Down

0 comments on commit a4c52b4

Please sign in to comment.