Move to new directory format.

This commit is contained in:
Arthur Britto
2012-07-07 17:46:47 -07:00
parent 4b20162e7f
commit e5ad771708
11 changed files with 368 additions and 295 deletions

View File

@@ -559,14 +559,17 @@ Json::Value RPCServer::doAccountLines(const Json::Value &params)
ret["account"] = naAccount.humanAccountID();
// We access a committed ledger and need not worry about changes.
uint256 uDirLineNodeFirst;
uint256 uDirLineNodeLast;
uint256 uRootIndex;
if (mNetOps->getDirLineInfo(uCurrent, naAccount, uDirLineNodeFirst, uDirLineNodeLast))
if (mNetOps->getDirLineInfo(uCurrent, naAccount, uRootIndex))
{
for (; uDirLineNodeFirst <= uDirLineNodeLast; uDirLineNodeFirst++)
bool bDone = false;
while (!bDone)
{
STVector256 svRippleNodes = mNetOps->getDirNode(uCurrent, uDirLineNodeFirst);
uint64 uNodePrevious;
uint64 uNodeNext;
STVector256 svRippleNodes = mNetOps->getDirNodeInfo(uCurrent, uRootIndex, uNodePrevious, uNodeNext);
BOOST_FOREACH(uint256& uNode, svRippleNodes.peekValue())
{
@@ -602,6 +605,15 @@ Json::Value RPCServer::doAccountLines(const Json::Value &params)
std::cerr << "doAccountLines: Bad index: " << uNode.ToString() << std::endl;
}
}
if (uNodeNext)
{
uCurrent = Ledger::getDirNodeIndex(uRootIndex, uNodeNext);
}
else
{
bDone = true;
}
}
}
ret["lines"] = jsonLines;