mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add RPC "accept_ledger" function which processes all pending transactions (in standalone mode only)
and closes the ledger, opening a new one. The sequence number of the new open ledger is returned.
This commit is contained in:
@@ -70,6 +70,7 @@ Json::Value RPCServer::RPCError(int iError)
|
||||
{ rpcNO_GEN_DECRPYT, "noGenDectypt", "Password failed to decrypt master public generator." },
|
||||
{ rpcNO_NETWORK, "noNetwork", "Network not available." },
|
||||
{ rpcNO_PERMISSION, "noPermission", "You don't have permission for this command." },
|
||||
{ rpcNOT_STANDALONE, "notStandAlone", "Operation valid in debug mode only." },
|
||||
{ rpcPASSWD_CHANGED, "passwdChanged", "Wrong key, password changed." },
|
||||
{ rpcPAYS_ACT_MALFORMED, "paysActMalformed", "Pays account malformed." },
|
||||
{ rpcPAYS_AMT_MALFORMED, "paysAmtMalformed", "Pays amount malformed." },
|
||||
@@ -419,6 +420,16 @@ Json::Value RPCServer::accountFromString(const uint256& uLedger, NewcoinAddress&
|
||||
return Json::Value(Json::objectValue);
|
||||
}
|
||||
|
||||
Json::Value RPCServer::doAcceptLedger(const Json::Value ¶ms)
|
||||
{
|
||||
if (!theConfig.RUN_STANDALONE)
|
||||
return RPCError(rpcNOT_STANDALONE);
|
||||
|
||||
Json::Value obj(Json::objectValue);
|
||||
obj["newLedger"] = theApp->getOPs().acceptLedger();
|
||||
return obj;
|
||||
}
|
||||
|
||||
// account_domain_set <seed> <paying_account> [<domain>]
|
||||
Json::Value RPCServer::doAccountDomainSet(const Json::Value ¶ms)
|
||||
{
|
||||
@@ -2641,6 +2652,7 @@ Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params
|
||||
bool mAdminRequired;
|
||||
unsigned int iOptions;
|
||||
} commandsA[] = {
|
||||
{ "accept_ledger", &RPCServer::doAcceptLedger, 0, 0, true },
|
||||
{ "account_domain_set", &RPCServer::doAccountDomainSet, 2, 3, false, optCurrent },
|
||||
{ "account_email_set", &RPCServer::doAccountEmailSet, 2, 3, false, optCurrent },
|
||||
{ "account_info", &RPCServer::doAccountInfo, 1, 2, false, optCurrent },
|
||||
|
||||
Reference in New Issue
Block a user