rippled
Loading...
Searching...
No Matches
LedgerAccept.cpp
1#include <xrpld/app/ledger/LedgerMaster.h>
2#include <xrpld/app/main/Application.h>
3#include <xrpld/app/misc/NetworkOPs.h>
4#include <xrpld/core/Config.h>
5#include <xrpld/rpc/Context.h>
6
7#include <xrpl/protocol/ErrorCodes.h>
8#include <xrpl/protocol/jss.h>
9
10#include <mutex>
11
12namespace ripple {
13
16{
17 Json::Value jvResult;
18
19 if (!context.app.config().standalone())
20 {
21 jvResult[jss::error] = "notStandAlone";
22 }
23 else
24 {
25 std::unique_lock lock{context.app.getMasterMutex()};
26 context.netOps.acceptLedger();
27 jvResult[jss::ledger_current_index] =
29 }
30
31 return jvResult;
32}
33
34} // namespace ripple
Represents a JSON value.
Definition json_value.h:131
virtual Config & config()=0
virtual MutexType & getMasterMutex()=0
bool standalone() const
Definition Config.h:317
LedgerIndex getCurrentLedgerIndex()
virtual std::uint32_t acceptLedger(std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)=0
Accepts the current transaction tree, return the new ledger's sequence.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Json::Value doLedgerAccept(RPC::JsonContext &)
Application & app
Definition Context.h:22
LedgerMaster & ledgerMaster
Definition Context.h:25
NetworkOPs & netOps
Definition Context.h:24