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