mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 13:35:54 +00:00
Fix RPC account_info to return actNotFound as appropriate.
This commit is contained in:
@@ -585,27 +585,24 @@ Json::Value RPCHandler::doAccountInfo(Json::Value jvRequest)
|
||||
|
||||
// Get info on account.
|
||||
|
||||
Json::Value jAccepted = accountFromString(lpLedger, naAccount, bIndex, strIdent, iIndex);
|
||||
Json::Value jvAccepted = accountFromString(lpLedger, naAccount, bIndex, strIdent, iIndex);
|
||||
|
||||
if (jAccepted.empty())
|
||||
if (!jvAccepted.empty())
|
||||
return jvAccepted;
|
||||
|
||||
AccountState::pointer asAccepted = mNetOps->getAccountState(lpLedger, naAccount);
|
||||
|
||||
if (asAccepted)
|
||||
{
|
||||
AccountState::pointer asAccepted = mNetOps->getAccountState(lpLedger, naAccount);
|
||||
asAccepted->addJson(jvAccepted);
|
||||
|
||||
if (asAccepted)
|
||||
asAccepted->addJson(jAccepted);
|
||||
jvResult["account_data"] = jvAccepted;
|
||||
}
|
||||
else
|
||||
{
|
||||
jvResult = rpcError(rpcACT_NOT_FOUND);
|
||||
}
|
||||
|
||||
jvResult["account_data"] = jAccepted;
|
||||
|
||||
#if 0
|
||||
if (!jAccepted && !asCurrent)
|
||||
{
|
||||
jvResult["account"] = naAccount.humanAccountID();
|
||||
jvResult["status"] = "NotFound";
|
||||
if (bIndex)
|
||||
jvResult["account_index"] = iIndex;
|
||||
}
|
||||
#endif
|
||||
return jvResult;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user