rippled
Loading...
Searching...
No Matches
LedgerClosed.cpp
1#include <xrpld/app/ledger/LedgerMaster.h>
2#include <xrpld/app/misc/NetworkOPs.h>
3#include <xrpld/rpc/Context.h>
4
5#include <xrpl/json/json_value.h>
6#include <xrpl/protocol/jss.h>
7
8namespace ripple {
9
12{
13 auto ledger = context.ledgerMaster.getClosedLedger();
14 XRPL_ASSERT(ledger, "ripple::doLedgerClosed : non-null closed ledger");
15
16 Json::Value jvResult;
17 jvResult[jss::ledger_index] = ledger->info().seq;
18 jvResult[jss::ledger_hash] = to_string(ledger->info().hash);
19
20 return jvResult;
21}
22
23} // namespace ripple
Represents a JSON value.
Definition json_value.h:131
std::shared_ptr< Ledger const > getClosedLedger()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Json::Value doLedgerClosed(RPC::JsonContext &)
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:611
LedgerMaster & ledgerMaster
Definition Context.h:25