Fix revoke reason check for ProUpRevTx (#2787)

This commit is contained in:
gladcow 2019-03-21 23:46:30 +03:00 committed by Alexander Block
parent 35914e0842
commit b52d0ad194

View File

@ -762,7 +762,7 @@ UniValue protx_revoke(const JSONRPCRequest& request)
if (request.params.size() > 3) {
int32_t nReason = ParseInt32V(request.params[3], "reason");
if (nReason < 0 || nReason >= CProUpRevTx::REASON_LAST) {
if (nReason < 0 || nReason > CProUpRevTx::REASON_LAST) {
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("invalid reason %d, must be between 0 and %d", nReason, CProUpRevTx::REASON_LAST));
}
ptx.nReason = (uint16_t)nReason;