xrpld
Loading...
Searching...
No Matches
FetchInfo.cpp
1#include <xrpld/rpc/Context.h>
2
3#include <xrpl/json/json_value.h>
4#include <xrpl/protocol/jss.h>
5#include <xrpl/server/NetworkOPs.h>
6
7namespace xrpl {
8
9json::Value
11{
13
14 if (context.params.isMember(jss::clear) && context.params[jss::clear].asBool())
15 {
16 context.netOps.clearLedgerFetch();
17 ret[jss::clear] = true;
18 }
19
20 ret[jss::info] = context.netOps.getLedgerFetchInfo();
21
22 return ret;
23}
24
25} // namespace xrpl
Represents a JSON value.
Definition json_value.h:130
bool asBool() const
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual json::Value getLedgerFetchInfo()=0
virtual void clearLedgerFetch()=0
@ Object
object value (collection of name/value pairs).
Definition json_value.h:26
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
json::Value doFetchInfo(RPC::JsonContext &context)
Definition FetchInfo.cpp:10
NetworkOPs & netOps
Definition Context.h:23
json::Value params
Definition Context.h:43