mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
fix: add missing client's argument parsing for RPC commands
This commit is contained in:
parent
37bd4009c1
commit
d3e181f516
@ -225,6 +225,10 @@ static const CRPCConvertParam vRPCConvertParams[] =
|
||||
{ "getnodeaddresses", 0, "count"},
|
||||
{ "addpeeraddress", 1, "port"},
|
||||
{ "stop", 0, "wait" },
|
||||
{ "verifychainlock", 2, "blockHeight" },
|
||||
{ "verifyislock", 3, "maxHeight" },
|
||||
{ "submitchainlock", 2, "blockHeight" },
|
||||
{ "mnauth", 0, "nodeId" },
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
|
@ -617,7 +617,7 @@ static RPCHelpMan mnauth()
|
||||
if (!Params().MineBlocksOnDemand())
|
||||
throw std::runtime_error("mnauth for regression testing (-regtest mode) only");
|
||||
|
||||
int nodeId = ParseInt64V(request.params[0], "nodeId");
|
||||
int64_t nodeId = request.params[0].get_int64();
|
||||
uint256 proTxHash = ParseHashV(request.params[1], "proTxHash");
|
||||
if (proTxHash.IsNull()) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "proTxHash invalid");
|
||||
|
@ -974,7 +974,7 @@ static RPCHelpMan verifychainlock()
|
||||
}
|
||||
nBlockHeight = pIndex->nHeight;
|
||||
} else {
|
||||
nBlockHeight = ParseInt32V(request.params[2], "blockHeight");
|
||||
nBlockHeight = request.params[2].get_int();
|
||||
LOCK(cs_main);
|
||||
if (nBlockHeight < 0) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
|
||||
@ -1040,7 +1040,7 @@ static RPCHelpMan verifyislock()
|
||||
|
||||
int maxHeight{-1};
|
||||
if (!request.params[3].isNull()) {
|
||||
maxHeight = ParseInt32V(request.params[3], "maxHeight");
|
||||
maxHeight = request.params[3].get_int();
|
||||
}
|
||||
|
||||
int signHeight;
|
||||
@ -1094,7 +1094,7 @@ static RPCHelpMan submitchainlock()
|
||||
{
|
||||
const uint256 nBlockHash(ParseHashV(request.params[0], "blockHash"));
|
||||
|
||||
const int nBlockHeight = ParseInt32V(request.params[2], "blockHeight");
|
||||
const int nBlockHeight = request.params[2].get_int();
|
||||
if (nBlockHeight <= 0) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "invalid block height");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user