This commit is contained in:
blackjok3r
2018-11-23 12:35:11 +08:00
parent c5ab57cfd7
commit deab4769ee

View File

@@ -115,23 +115,15 @@ UniValue getiguanajson(const UniValue& params, bool fHelp)
UniValue getnotarysendmany(const UniValue& params, bool fHelp) UniValue getnotarysendmany(const UniValue& params, bool fHelp)
{ {
if (fHelp || params.size() > 2) if (fHelp || params.size() != 1)
throw runtime_error( throw runtime_error(
"getnotarysendmany ( era amount_to_send )\n" "getnotarysendmany ( amount_to_send )\n"
"\nReturn a sendmany array for all notary address in defined era.\n" "\nReturn a sendmany array for all notary address in current era.\n"
); );
// era // era
int era = 0; int era = getera(time(NULL));
if (params.size() > 0) {
era = params[0].get_int();
}
if (era < 0 || era > NUM_STAKED_ERAS) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "era is not valid");
}
// Amount // Amount
CAmount nAmount; CAmount nAmount = AmountFromValue(params[1]);
if (params.size() > 1)
nAmount = AmountFromValue(params[1]);
if (nAmount <= 0) if (nAmount <= 0)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for send"); throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for send");