Rework Ledger index calculation.

This commit is contained in:
Arthur Britto
2012-05-31 20:26:14 -07:00
parent e10505d2a7
commit a0009f7c6f
8 changed files with 66 additions and 47 deletions

View File

@@ -172,11 +172,10 @@ SLE::pointer NetworkOPs::getGenerator(const uint256& uLedger, const uint160& uGe
bool NetworkOPs::getDirInfo(
const uint256& uLedger,
const uint256& uBase,
const LedgerEntryType letKind,
uint256& uDirLineNodeFirst,
uint256& uDirLineNodeLast)
{
uint256 uRootIndex = Ledger::getDirIndex(uBase, letKind);
uint256 uRootIndex = Ledger::getDirIndex(uBase, 0);
LedgerStateParms lspRoot = lepNONE;
SLE::pointer sleRoot = mLedgerMaster->getLedgerByHash(uLedger)->getDirRoot(lspRoot, uRootIndex);
@@ -186,8 +185,8 @@ bool NetworkOPs::getDirInfo(
std::cerr << "getDirInfo: first: " << strHex(sleRoot->getIFieldU64(sfFirstNode)) << std::endl;
std::cerr << "getDirInfo: last: " << strHex(sleRoot->getIFieldU64(sfLastNode)) << std::endl;
uDirLineNodeFirst = Ledger::getDirIndex(uBase, letKind, sleRoot->getIFieldU64(sfFirstNode));
uDirLineNodeLast = Ledger::getDirIndex(uBase, letKind, sleRoot->getIFieldU64(sfLastNode));
uDirLineNodeFirst = Ledger::getDirIndex(uBase, sleRoot->getIFieldU64(sfFirstNode));
uDirLineNodeLast = Ledger::getDirIndex(uBase, sleRoot->getIFieldU64(sfLastNode));
std::cerr << "getDirInfo: first: " << uDirLineNodeFirst.ToString() << std::endl;
std::cerr << "getDirInfo: last: " << uDirLineNodeLast.ToString() << std::endl;