mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 01:07:57 +00:00
Feature friendly names.
This commit is contained in:
@@ -9,6 +9,7 @@ void FeatureTable::addInitialFeatures()
|
||||
// getCreateFeature. Set any vetoes or defaults. A pointer to the FeatureState can be stashed
|
||||
|
||||
testFeature = getCreateFeature(uint256("1234"), true);
|
||||
testFeature->setFriendlyName("testFeature");
|
||||
}
|
||||
|
||||
FeatureState* FeatureTable::getCreateFeature(const uint256& featureHash, bool create)
|
||||
@@ -299,6 +300,9 @@ Json::Value FeatureTable::getJson(int)
|
||||
{
|
||||
Json::Value& v(ret[it.first.GetHex()] = Json::objectValue);
|
||||
|
||||
if (!it.second.mFriendlyName.empty())
|
||||
v["name"] = it.second.mFriendlyName;
|
||||
|
||||
v["supported"] = it.second.mSupported;
|
||||
|
||||
if (it.second.mEnabled)
|
||||
|
||||
@@ -21,24 +21,28 @@ public:
|
||||
class FeatureState
|
||||
{
|
||||
public:
|
||||
bool mVetoed; // We don't want this feature enabled
|
||||
bool mEnabled;
|
||||
bool mSupported;
|
||||
bool mDefault; // Include in genesis ledger
|
||||
bool mVetoed; // We don't want this feature enabled
|
||||
bool mEnabled;
|
||||
bool mSupported;
|
||||
bool mDefault; // Include in genesis ledger
|
||||
|
||||
uint32 mFirstMajority; // First time we saw a majority (close time)
|
||||
uint32 mLastMajority; // Most recent time we saw a majority (close time)
|
||||
uint32 mFirstMajority; // First time we saw a majority (close time)
|
||||
uint32 mLastMajority; // Most recent time we saw a majority (close time)
|
||||
|
||||
std::string mFriendlyName;
|
||||
|
||||
FeatureState()
|
||||
: mVetoed(false), mEnabled(false), mSupported(false), mDefault(false),
|
||||
mFirstMajority(0), mLastMajority(0) { ; }
|
||||
|
||||
void setVeto() { mVetoed = true; }
|
||||
void setDefault() { mDefault = true; }
|
||||
bool isDefault() { return mDefault; }
|
||||
bool isSupported() { return mSupported; }
|
||||
bool isVetoed() { return mVetoed; }
|
||||
bool isEnabled() { return mEnabled; }
|
||||
void setVeto() { mVetoed = true; }
|
||||
void setDefault() { mDefault = true; }
|
||||
bool isDefault() { return mDefault; }
|
||||
bool isSupported() { return mSupported; }
|
||||
bool isVetoed() { return mVetoed; }
|
||||
bool isEnabled() { return mEnabled; }
|
||||
const std::string& getFiendlyName() { return mFriendlyName; }
|
||||
void setFriendlyName(const std::string& n) { mFriendlyName = n; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user