mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Get RPC account_lines mostly working.
This commit is contained in:
@@ -382,19 +382,16 @@ Json::Value RPCServer::doAccountLines(Json::Value ¶ms)
|
||||
AccountState::pointer as = mNetOps->getAccountState(uLedger, naAccount);
|
||||
if (as)
|
||||
{
|
||||
Json::Value jsonLines = Json::Value(Json::objectValue);
|
||||
|
||||
ret["account"] = naAccount.humanAccountID();
|
||||
|
||||
// We access a committed ledger and need not worry about changes.
|
||||
uint256 uDirLineNodeFirst;
|
||||
uint256 uDirLineNodeLast;
|
||||
|
||||
if (!mNetOps->getDirLineInfo(uLedger, naAccount, uDirLineNodeFirst, uDirLineNodeLast))
|
||||
if (mNetOps->getDirLineInfo(uLedger, naAccount, uDirLineNodeFirst, uDirLineNodeLast))
|
||||
{
|
||||
ret["lines"] = Json::Value(Json::objectValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
Json::Value jsonLines = Json::Value(Json::objectValue);
|
||||
|
||||
for (; uDirLineNodeFirst <= uDirLineNodeLast; uDirLineNodeFirst++)
|
||||
{
|
||||
@@ -423,13 +420,12 @@ Json::Value RPCServer::doAccountLines(Json::Value ¶ms)
|
||||
jPeer["limit"] = saLimit.getJson(0);
|
||||
jPeer["limit_peer"] = saLimitPeer.getJson(0);
|
||||
|
||||
ret[naAccountPeer.humanAccountID()] = jPeer;
|
||||
jsonLines[naAccountPeer.humanAccountID()] = jPeer;
|
||||
}
|
||||
}
|
||||
|
||||
ret["lines"] = jsonLines;
|
||||
|
||||
}
|
||||
ret["lines"] = jsonLines;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user