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 (!jvAccepted.empty())
return jvAccepted;
if (jAccepted.empty())
{
AccountState::pointer asAccepted = mNetOps->getAccountState(lpLedger, naAccount); AccountState::pointer asAccepted = mNetOps->getAccountState(lpLedger, naAccount);
if (asAccepted) if (asAccepted)
asAccepted->addJson(jAccepted);
}
jvResult["account_data"] = jAccepted;
#if 0
if (!jAccepted && !asCurrent)
{ {
jvResult["account"] = naAccount.humanAccountID(); asAccepted->addJson(jvAccepted);
jvResult["status"] = "NotFound";
if (bIndex) jvResult["account_data"] = jvAccepted;
jvResult["account_index"] = iIndex;
} }
#endif else
{
jvResult = rpcError(rpcACT_NOT_FOUND);
}
return jvResult; return jvResult;
} }