xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
rpc
handlers
admin
status
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
7
namespace
xrpl
{
8
9
json::Value
10
doFetchInfo
(
rpc::JsonContext
& context)
11
{
12
json::Value
ret(
json::ValueType::Object
);
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
json::Value
Represents a JSON value.
Definition
json_value.h:117
json::Value::asBool
bool asBool() const
Definition
json_value.cpp:708
json::Value::isMember
bool isMember(char const *key) const
Return true if the object has a member named key.
Definition
json_value.cpp:1049
xrpl::NetworkOPs::getLedgerFetchInfo
virtual json::Value getLedgerFetchInfo()=0
xrpl::NetworkOPs::clearLedgerFetch
virtual void clearLedgerFetch()=0
json::ValueType::Object
@ Object
object value (collection of name/value pairs).
Definition
json_value.h:29
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::doFetchInfo
json::Value doFetchInfo(rpc::JsonContext &context)
Definition
FetchInfo.cpp:10
xrpl::rpc::Context::netOps
NetworkOPs & netOps
Definition
Context.h:31
xrpl::rpc::JsonContext
Definition
Context.h:41
xrpl::rpc::JsonContext::params
json::Value params
Definition
Context.h:51
Generated by
1.17.0