Skip to content

Commit

Permalink
Fix logic for sleep_time parameters in votegovbatch
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric ogire committed Mar 17, 2023
1 parent 9fcb98c commit 7d27682
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/masternodes/rpc_proposals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,8 @@ UniValue votegovbatch(const JSONRPCRequest &request) {
{"proposalId", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "The proposal txid"},
{"masternodeId", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "The masternode ID, operator or owner address"},
{"decision", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "The vote decision (yes/no/neutral)"},
}},
}
},
{"sleepTime", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "Sets sleeping time for voteGovBatch, by default the value is set to 500ms"}
},
RPCResult{"\"hash\" (string) The hex-encoded hash of broadcasted transaction\n"},
Expand All @@ -612,7 +613,7 @@ UniValue votegovbatch(const JSONRPCRequest &request) {
RPCTypeCheck(request.params, {UniValue::VARR}, false);

const auto &keys = request.params[0].get_array();
auto sleepTime = request.params[1].isNull() ? SLEEP_TIME_MILLIS : request.params[1].get_int();
auto sleepTime = (request.params.size() > 1 && request.params[1].isNull()) ? SLEEP_TIME_MILLIS : request.params[1].get_int();
auto neutralVotesAllowed = gArgs.GetBoolArg("-rpc-governance-accept-neutral", DEFAULT_RPC_GOV_NEUTRAL);

int targetHeight;
Expand Down

0 comments on commit 7d27682

Please sign in to comment.