mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
fix(rpc): don't parse platformHTTPPort platformP2PPort as strings (#5217)
## Issue being fixed or feature implemented In `protx register_hpmn`, `protx register_fund_hpmn`, `protx register_prepare_hpmn` and `protx update_service_hpmn` the fields `platformHTTPPort` and `platformP2PPort` were parsed as strings instead of integers. ## What was done? ## How Has This Been Tested? ## Breaking Changes ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation **For repository code-owners and collaborators only** - [x] I have assigned this pull request to a milestone
This commit is contained in:
parent
3a24170ac3
commit
01ebd60187
@ -665,13 +665,13 @@ static UniValue protx_register_common_wrapper(const JSONRPCRequest& request,
|
||||
}
|
||||
ptx.platformNodeID.SetHex(request.params[paramIdx + 6].get_str());
|
||||
|
||||
int32_t requestedPlatformP2PPort = ParseInt32V(request.params[paramIdx + 7].get_str(), "platformP2PPort");
|
||||
int32_t requestedPlatformP2PPort = ParseInt32V(request.params[paramIdx + 7], "platformP2PPort");
|
||||
if (!ValidatePlatformPort(requestedPlatformP2PPort)) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "platformP2PPort must be a valid port [1-65535]");
|
||||
}
|
||||
ptx.platformP2PPort = static_cast<uint16_t>(requestedPlatformP2PPort);
|
||||
|
||||
int32_t requestedPlatformHTTPPort = ParseInt32V(request.params[paramIdx + 8].get_str(), "platformHTTPPort");
|
||||
int32_t requestedPlatformHTTPPort = ParseInt32V(request.params[paramIdx + 8], "platformHTTPPort");
|
||||
if (!ValidatePlatformPort(requestedPlatformHTTPPort)) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "platformHTTPPort must be a valid port [1-65535]");
|
||||
}
|
||||
@ -899,13 +899,13 @@ static UniValue protx_update_service_common_wrapper(const JSONRPCRequest& reques
|
||||
}
|
||||
ptx.platformNodeID.SetHex(request.params[paramIdx].get_str());
|
||||
|
||||
int32_t requestedPlatformP2PPort = ParseInt32V(request.params[paramIdx + 1].get_str(), "platformP2PPort");
|
||||
int32_t requestedPlatformP2PPort = ParseInt32V(request.params[paramIdx + 1], "platformP2PPort");
|
||||
if (!ValidatePlatformPort(requestedPlatformP2PPort)) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "platformP2PPort must be a valid port [1-65535]");
|
||||
}
|
||||
ptx.platformP2PPort = static_cast<uint16_t>(requestedPlatformP2PPort);
|
||||
|
||||
int32_t requestedPlatformHTTPPort = ParseInt32V(request.params[paramIdx + 2].get_str(), "platformHTTPPort");
|
||||
int32_t requestedPlatformHTTPPort = ParseInt32V(request.params[paramIdx + 2], "platformHTTPPort");
|
||||
if (!ValidatePlatformPort(requestedPlatformHTTPPort)) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "platformHTTPPort must be a valid port [1-65535]");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user