[dashpay/dash] adds rpc calls for `setprivatesendrounds` and `setprivatesendamount` (#2230)

PastaPastaPasta commented on this pull request.

> + if (request.fHelp || request.params.size() != 1)
+ throw std::runtime_error(
+ «setprivatesendrounds rounds\n»
+ «\nSet the number of rounds for PrivateSend mixing.\n»
+ «\nArguments:\n»
+ «1. rounds (numeric, required) The default number of rounds is » + std::to_string(DEFAULT_PRIVATESEND_ROUNDS) +
+ » Cannot be more than » + std::to_string(MAX_PRIVATESEND_ROUNDS) + » nor less than » + std::to_string(MIN_PRIVATESEND_ROUNDS) +
+ «\nExamples:\n»
+ + HelpExampleCli(«setprivatesendrounds», «4»)
+ + HelpExampleRpc(«setprivatesendrounds», «16»)
+ );
+
+
+ int nRounds = request.params[0].get_int();
+
+ privateSendClient.nPrivateSendRounds = nRounds;

Would that be best, or would it be better to return an error / return `false` if it doesn’t fit in the range?

Добавить комментарий