From 9fcb98c12c504cd3500ff8265a81ae5a22ebde1c Mon Sep 17 00:00:00 2001 From: cedric ogire Date: Fri, 17 Mar 2023 17:04:19 +0800 Subject: [PATCH] Move sleep-time from node argument to rpc argument --- src/init.cpp | 1 - src/masternodes/rpc_proposals.cpp | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index eb4f345edc..217cb38702 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -637,7 +637,6 @@ void SetupServerArgs() gArgs.AddArg("-dftxworkers=", strprintf("No. of parallel workers associated with the DfTx related work pool. Stock splits, parallel processing of the chain where appropriate, etc use this worker pool (default: %d)", DEFAULT_DFTX_WORKERS), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); gArgs.AddArg("-maxaddrratepersecond=", strprintf("Sets MAX_ADDR_RATE_PER_SECOND limit for ADDR messages(default: %f)", MAX_ADDR_RATE_PER_SECOND), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); gArgs.AddArg("-maxaddrprocessingtokenbucket=", strprintf("Sets MAX_ADDR_PROCESSING_TOKEN_BUCKET limit for ADDR messages(default: %d)", MAX_ADDR_PROCESSING_TOKEN_BUCKET), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); - gArgs.AddArg("-sleep-time=", "Sets sleeping time for voteGovBatch, by default the value is set to 500ms", ArgsManager::ALLOW_ANY, OptionsCategory::HIDDEN); #if HAVE_DECL_DAEMON gArgs.AddArg("-daemon", "Run in the background as a daemon and accept commands", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); diff --git a/src/masternodes/rpc_proposals.cpp b/src/masternodes/rpc_proposals.cpp index ffc0aecdfc..ecf974963f 100644 --- a/src/masternodes/rpc_proposals.cpp +++ b/src/masternodes/rpc_proposals.cpp @@ -596,7 +596,8 @@ UniValue votegovbatch(const JSONRPCRequest &request) { {"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"}, RPCExamples{HelpExampleCli("votegovbatch", "{{proposalId, masternodeId, yes}...}") + HelpExampleRpc("votegovbatch", "{{proposalId, masternodeId, yes}...}")}, @@ -611,7 +612,7 @@ UniValue votegovbatch(const JSONRPCRequest &request) { RPCTypeCheck(request.params, {UniValue::VARR}, false); const auto &keys = request.params[0].get_array(); - auto sleepTime = gArgs.GetBoolArg("-sleep-time", SLEEP_TIME_MILLIS); + auto sleepTime = 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;