rippled
Loading...
Searching...
No Matches
ServerState.cpp
1#include <xrpld/app/misc/NetworkOPs.h>
2#include <xrpld/rpc/Context.h>
3#include <xrpld/rpc/Role.h>
4
5#include <xrpl/json/json_value.h>
6#include <xrpl/protocol/jss.h>
7
8namespace ripple {
9
12{
14
15 ret[jss::state] = context.netOps.getServerInfo(
16 false,
17 context.role == Role::ADMIN,
18 context.params.isMember(jss::counters) &&
19 context.params[jss::counters].asBool());
20
21 return ret;
22}
23
24} // 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 Json::Value getServerInfo(bool human, bool admin, bool counters)=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 doServerState(RPC::JsonContext &)
NetworkOPs & netOps
Definition Context.h:24