rippled
Loading...
Searching...
No Matches
xrpld
rpc
handlers
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
12
namespace
ripple
{
13
14
Json::Value
15
doLedgerAccept
(
RPC::JsonContext
& context)
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] =
28
context.
ledgerMaster
.
getCurrentLedgerIndex
();
29
}
30
31
return
jvResult;
32
}
33
34
}
// namespace ripple
Json::Value
Represents a JSON value.
Definition
json_value.h:131
ripple::Application::config
virtual Config & config()=0
ripple::Application::getMasterMutex
virtual MutexType & getMasterMutex()=0
ripple::Config::standalone
bool standalone() const
Definition
Config.h:317
ripple::LedgerMaster::getCurrentLedgerIndex
LedgerIndex getCurrentLedgerIndex()
Definition
LedgerMaster.cpp:104
ripple::NetworkOPs::acceptLedger
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.
mutex
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:6
ripple::doLedgerAccept
Json::Value doLedgerAccept(RPC::JsonContext &)
Definition
LedgerAccept.cpp:15
ripple::RPC::Context::app
Application & app
Definition
Context.h:22
ripple::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition
Context.h:25
ripple::RPC::Context::netOps
NetworkOPs & netOps
Definition
Context.h:24
ripple::RPC::JsonContext
Definition
Context.h:34
std::unique_lock
Generated by
1.9.8