mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Report ledger information in account_lines RPC (RIPD-1276)
This commit is contained in:
@@ -93,9 +93,12 @@ Json::Value doAccountLines (RPC::Context& context)
|
|||||||
std::string strIdent (params[jss::account].asString ());
|
std::string strIdent (params[jss::account].asString ());
|
||||||
AccountID accountID;
|
AccountID accountID;
|
||||||
|
|
||||||
// Intentional assignment in if. Extra parentheses silence warning.
|
if (auto jv = RPC::accountFromString (accountID, strIdent))
|
||||||
if ((result = RPC::accountFromString (accountID, strIdent)))
|
{
|
||||||
|
for (auto it = jv.begin (); it != jv.end (); ++it)
|
||||||
|
result[it.memberName ()] = *it;
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
if (! ledger->exists(keylet::account (accountID)))
|
if (! ledger->exists(keylet::account (accountID)))
|
||||||
return rpcError (rpcACT_NOT_FOUND);
|
return rpcError (rpcACT_NOT_FOUND);
|
||||||
@@ -108,10 +111,13 @@ Json::Value doAccountLines (RPC::Context& context)
|
|||||||
AccountID raPeerAccount;
|
AccountID raPeerAccount;
|
||||||
if (hasPeer)
|
if (hasPeer)
|
||||||
{
|
{
|
||||||
// Intentional assignment in if. Extra parentheses silence warning.
|
if (auto jv = RPC::accountFromString (raPeerAccount, strPeer))
|
||||||
if ((result = RPC::accountFromString (raPeerAccount, strPeer)))
|
{
|
||||||
|
for (auto it = jv.begin (); it != jv.end (); ++it)
|
||||||
|
result[it.memberName ()] = *it;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int limit;
|
unsigned int limit;
|
||||||
if (auto err = readLimitField(limit, RPC::Tuning::accountLines, context))
|
if (auto err = readLimitField(limit, RPC::Tuning::accountLines, context))
|
||||||
|
|||||||
Reference in New Issue
Block a user