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