Fix RPC account_info to return actNotFound as appropriate.

This commit is contained in:
Arthur Britto
2013-02-10 02:26:43 -08:00
parent e5220a721c
commit 4e1f0c2c60

View File

@@ -585,27 +585,24 @@ Json::Value RPCHandler::doAccountInfo(Json::Value jvRequest)
// Get info on account. // 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) jvResult["account_data"] = jvAccepted;
asAccepted->addJson(jAccepted); }
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; return jvResult;
} }