Merge branch 'develop' into feature

This commit is contained in:
JoelKatz
2013-05-30 12:06:32 -07:00
4 changed files with 10 additions and 6 deletions

View File

@@ -190,6 +190,11 @@ void Ledger::setAccepted()
setImmutable();
}
bool Ledger::hasAccount(const RippleAddress& accountID)
{
return mAccountStateMap->hasItem(Ledger::getAccountRootIndex(accountID));
}
AccountState::pointer Ledger::getAccountState(const RippleAddress& accountID)
{
#ifdef DEBUG

View File

@@ -183,6 +183,7 @@ public:
TransactionMetaSet::pointer& txMeta);
// high-level functions
bool hasAccount(const RippleAddress& acctID);
AccountState::pointer getAccountState(const RippleAddress& acctID);
LedgerStateParms writeBack(LedgerStateParms parms, SLE::ref);
SLE::pointer getAccountRoot(const uint160& accountID);

View File

@@ -1062,9 +1062,7 @@ Json::Value RPCHandler::doAccountLines(Json::Value jvRequest, int& cost, ScopedL
return jvResult;
}
AccountState::pointer as = mNetOps->getAccountState(lpLedger, raAccount);
if (as)
if (lpLedger->hasAccount(raAccount))
{
jvResult["account"] = raAccount.humanAccountID();
@@ -1140,9 +1138,7 @@ Json::Value RPCHandler::doAccountOffers(Json::Value jvRequest, int& cost, Scoped
if (bIndex)
jvResult["account_index"] = iIndex;
AccountState::pointer as = mNetOps->getAccountState(lpLedger, raAccount);
if (as)
if (lpLedger->hasAccount(raAccount))
{
Json::Value& jsonLines = (jvResult["offers"] = Json::arrayValue);