mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-24 13:05:53 +00:00
Stuctures for feature enabling.
This commit is contained in:
@@ -918,6 +918,13 @@ uint256 Ledger::getAccountRootIndex(const uint160& uAccountID)
|
||||
return s.getSHA512Half();
|
||||
}
|
||||
|
||||
uint256 Ledger::getLedgerFeatureIndex()
|
||||
{ // get the index of the node that holds the last 256 ledgers
|
||||
Serializer s(2);
|
||||
s.add16(spaceFeature);
|
||||
return s.getSHA512Half();
|
||||
}
|
||||
|
||||
uint256 Ledger::getLedgerHashIndex()
|
||||
{ // get the index of the node that holds the last 256 ledgers
|
||||
Serializer s(2);
|
||||
|
||||
@@ -193,6 +193,8 @@ public:
|
||||
static int getLedgerHashOffset(uint32 desiredLedgerIndex);
|
||||
static int getLedgerHashOffset(uint32 desiredLedgerIndex, uint32 currentLedgerIndex);
|
||||
|
||||
static uint256 getLedgerFeatureIndex();
|
||||
|
||||
// index calculation functions
|
||||
static uint256 getAccountRootIndex(const uint160& uAccountID);
|
||||
|
||||
|
||||
@@ -98,6 +98,10 @@ static bool LEFInit()
|
||||
<< SOElement(sfHashes, SOE_REQUIRED)
|
||||
;
|
||||
|
||||
DECLARE_LEF(EnabledFeatures, ltFEATURES)
|
||||
<< SOElement(sfEnabledFeatures, SOE_REQUIRED)
|
||||
;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ enum LedgerEntryType
|
||||
ltOFFER = 'o',
|
||||
ltCONTRACT = 'c',
|
||||
ltLEDGER_HASHES = 'h',
|
||||
ltFEATURES = 'f',
|
||||
};
|
||||
|
||||
// Used as a prefix for computing ledger indexes (keys).
|
||||
@@ -30,6 +31,7 @@ enum LedgerNameSpace
|
||||
spaceBookDir = 'B', // Directory of order books.
|
||||
spaceContract = 'c',
|
||||
spaceSkipList = 's',
|
||||
spaceFeature = 'f',
|
||||
};
|
||||
|
||||
enum LedgerSpecificFlags
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
FIELD(BookDirectory, HASH256, 16)
|
||||
FIELD(InvoiceID, HASH256, 17)
|
||||
FIELD(Nickname, HASH256, 18)
|
||||
FIELD(Feature, HASH256, 19)
|
||||
|
||||
// 160-bit (common)
|
||||
FIELD(TakerPaysCurrency, HASH160, 1)
|
||||
@@ -154,5 +155,6 @@
|
||||
FIELD(Necessary, ARRAY, 6)
|
||||
FIELD(Sufficient, ARRAY, 7)
|
||||
FIELD(AffectedNodes, ARRAY, 8)
|
||||
FIELD(EnabledFeatures, ARRAY, 9)
|
||||
|
||||
// vim:ts=4
|
||||
|
||||
@@ -71,6 +71,10 @@ static bool TFInit()
|
||||
<< SOElement(sfTarget, SOE_REQUIRED)
|
||||
;
|
||||
|
||||
DECLARE_TF(EnableFeature, ttFEATURE)
|
||||
<< SOElement(sfFeature, SOE_REQUIRED)
|
||||
;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ enum TransactionType
|
||||
ttCONTRACT_REMOVE = 10, // can we use the same msg as offer cancel
|
||||
|
||||
ttTRUST_SET = 20,
|
||||
|
||||
ttFEATURE = 100,
|
||||
};
|
||||
|
||||
class TransactionFormat
|
||||
|
||||
Reference in New Issue
Block a user