1#include <xrpld/app/ledger/LedgerMaster.h>
2#include <xrpld/app/main/Application.h>
3#include <xrpld/rpc/Context.h>
4#include <xrpld/rpc/Role.h>
6#include <xrpl/basics/base_uint.h>
7#include <xrpl/json/json_value.h>
8#include <xrpl/ledger/AmendmentTable.h>
9#include <xrpl/ledger/View.h>
10#include <xrpl/protocol/ErrorCodes.h>
11#include <xrpl/protocol/RPCErr.h>
12#include <xrpl/protocol/jss.h>
43 auto features = table.getJson(
isAdmin);
45 for (
auto const& [h, t] : majorities)
47 features[
to_string(h)][jss::majority] = t.time_since_epoch().count();
51 jvReply[jss::features] = features;
59 if (!feature && !feature.parseHex(context.
params[jss::feature].
asString()))
73 table.unVeto(feature);
81 auto m = majorities.
find(feature);
82 if (m != majorities.
end())
83 jvReply[jss::majority] = m->second.time_since_epoch().count();
std::string asString() const
Returns the unquoted string value.
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual uint256 find(std::string const &name) const =0
std::shared_ptr< Ledger const > getValidatedLedger()
virtual AmendmentTable & getAmendmentTable()=0
@ Object
object value (collection of name/value pairs).
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
json::Value doFeature(RPC::JsonContext &)
std::string to_string(BaseUInt< Bits, Tag > const &a)
json::Value rpcError(ErrorCodeI iError)
majorityAmendments_t getMajorityAmendments(ReadView const &view)
std::map< uint256, NetClock::time_point > majorityAmendments_t
bool isAdmin(Port const &port, json::Value const ¶ms, beast::IP::Address const &remoteIp)
LedgerMaster & ledgerMaster