Structures for self-descriptive directory nodes.

This commit is contained in:
JoelKatz
2012-11-30 00:12:25 -08:00
parent e8abe71ea8
commit 1d3a17b59d
3 changed files with 15 additions and 2 deletions

View File

@@ -262,7 +262,7 @@ public:
// Directories are doubly linked lists of nodes.
// Given a directory root and and index compute the index of a node.
static uint256 getDirNodeIndex(const uint256& uDirRoot, const uint64 uNodeIndex=0);
static uint256 getDirNodeIndex(const uint256& uDirRoot, const uint64 uNodeIndex = 0);
// Return a node: root or normal
SLE::pointer getDirNode(LedgerStateParms& parms, const uint256& uNodeIndex);
@@ -271,7 +271,7 @@ public:
// Quality
//
static uint256 getQualityIndex(const uint256& uBase, const uint64 uNodeDir=0);
static uint256 getQualityIndex(const uint256& uBase, const uint64 uNodeDir = 0);
static uint256 getQualityNext(const uint256& uBase);
static uint64 getQuality(const uint256& uBase);

View File

@@ -46,6 +46,12 @@ static bool LEFInit()
;
DECLARE_LEF(DirectoryNode, ltDIR_NODE)
<< SOElement(sfOwner, SOE_OPTIONAL) // for owner directories
<< SOElement(sfTakerPaysCurrency, SOE_OPTIONAL) // for order book directories
<< SOElement(sfTakerPaysIssuer, SOE_OPTIONAL) // for order book directories
<< SOElement(sfTakerGetsCurrency, SOE_OPTIONAL) // for order book directories
<< SOElement(sfTakerGetsIssuer, SOE_OPTIONAL) // for order book directories
<< SOElement(sfExhangeRate, SOE_OPTIONAL) // for order book directories
<< SOElement(sfIndexes, SOE_REQUIRED)
<< SOElement(sfRootIndex, SOE_REQUIRED)
<< SOElement(sfIndexNext, SOE_OPTIONAL)

View File

@@ -65,6 +65,7 @@
FIELD(BookNode, UINT64, 3)
FIELD(OwnerNode, UINT64, 4)
FIELD(BaseFee, UINT64, 5)
FIELD(ExchangeRate, UINT64, 6)
// 128-bit
FIELD(EmailHash, HASH128, 1)
@@ -84,6 +85,12 @@
FIELD(InvoiceID, HASH256, 17)
FIELD(Nickname, HASH256, 18)
// 160-bit (common)
FIELD(TakerPaysCurrency, HASH160, 1)
FIELD(TakerPaysIssuer, HASH160, 2)
FIELD(TakerGetsCurrency, HASH160, 3)
FIELD(TakerGetsIssuer, HASH160, 4)
// currency amount (common)
FIELD(Amount, AMOUNT, 1)
FIELD(Balance, AMOUNT, 2)