try
This commit is contained in:
@@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user