mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 03:26:01 +00:00
Disable the JSON cache due to issue 99.
This commit is contained in:
@@ -1098,49 +1098,36 @@ Json::Value RPCHandler::doAccountLines (Json::Value params, LoadType* loadType,
|
|||||||
if (lpLedger->hasAccount (raAccount))
|
if (lpLedger->hasAccount (raAccount))
|
||||||
{
|
{
|
||||||
jvResult["account"] = raAccount.humanAccountID ();
|
jvResult["account"] = raAccount.humanAccountID ();
|
||||||
|
Json::Value& jsonLines = (jvResult["lines"] = Json::arrayValue);
|
||||||
|
|
||||||
boost::shared_ptr<Json::Value> jvsLines =
|
AccountItems rippleLines (raAccount.getAccountID (), lpLedger, AccountItem::pointer (new RippleState ()));
|
||||||
theApp->getOPs ().getJSONCache (JSONCache::kindLines, lpLedger->getHash (), raAccount.getAccountID ());
|
|
||||||
|
|
||||||
if (!jvsLines)
|
BOOST_FOREACH (AccountItem::ref item, rippleLines.getItems ())
|
||||||
{
|
{
|
||||||
jvsLines = boost::make_shared<Json::Value> (Json::arrayValue);
|
RippleState* line = (RippleState*)item.get ();
|
||||||
Json::Value& jsonLines = *jvsLines;
|
|
||||||
|
|
||||||
AccountItems rippleLines (raAccount.getAccountID (), lpLedger, AccountItem::pointer (new RippleState ()));
|
if (!raPeer.isValid () || raPeer.getAccountID () == line->getAccountIDPeer ())
|
||||||
|
|
||||||
BOOST_FOREACH (AccountItem::ref item, rippleLines.getItems ())
|
|
||||||
{
|
{
|
||||||
RippleState* line = (RippleState*)item.get ();
|
const STAmount& saBalance = line->getBalance ();
|
||||||
|
const STAmount& saLimit = line->getLimit ();
|
||||||
|
const STAmount& saLimitPeer = line->getLimitPeer ();
|
||||||
|
|
||||||
if (!raPeer.isValid () || raPeer.getAccountID () == line->getAccountIDPeer ())
|
Json::Value& jPeer = jsonLines.append (Json::objectValue);
|
||||||
{
|
|
||||||
const STAmount& saBalance = line->getBalance ();
|
|
||||||
const STAmount& saLimit = line->getLimit ();
|
|
||||||
const STAmount& saLimitPeer = line->getLimitPeer ();
|
|
||||||
|
|
||||||
Json::Value& jPeer = jsonLines.append (Json::objectValue);
|
jPeer["account"] = RippleAddress::createHumanAccountID (line->getAccountIDPeer ());
|
||||||
|
// Amount reported is positive if current account holds other account's IOUs.
|
||||||
jPeer["account"] = RippleAddress::createHumanAccountID (line->getAccountIDPeer ());
|
// Amount reported is negative if other account holds current account's IOUs.
|
||||||
// Amount reported is positive if current account holds other account's IOUs.
|
jPeer["balance"] = saBalance.getText ();
|
||||||
// Amount reported is negative if other account holds current account's IOUs.
|
jPeer["currency"] = saBalance.getHumanCurrency ();
|
||||||
jPeer["balance"] = saBalance.getText ();
|
jPeer["limit"] = saLimit.getText ();
|
||||||
jPeer["currency"] = saBalance.getHumanCurrency ();
|
jPeer["limit_peer"] = saLimitPeer.getText ();
|
||||||
jPeer["limit"] = saLimit.getText ();
|
jPeer["quality_in"] = static_cast<Json::UInt> (line->getQualityIn ());
|
||||||
jPeer["limit_peer"] = saLimitPeer.getText ();
|
jPeer["quality_out"] = static_cast<Json::UInt> (line->getQualityOut ());
|
||||||
jPeer["quality_in"] = static_cast<Json::UInt> (line->getQualityIn ());
|
|
||||||
jPeer["quality_out"] = static_cast<Json::UInt> (line->getQualityOut ());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
theApp->getOPs ().storeJSONCache (JSONCache::kindLines, lpLedger->getHash (),
|
|
||||||
raAccount.getAccountID (), jvsLines);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bUnlocked)
|
if (!bUnlocked)
|
||||||
MasterLockHolder.unlock ();
|
MasterLockHolder.unlock ();
|
||||||
|
|
||||||
jvResult["lines"] = *jvsLines;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1208,21 +1195,12 @@ Json::Value RPCHandler::doAccountOffers (Json::Value params, LoadType* loadType,
|
|||||||
if (!lpLedger->hasAccount (raAccount))
|
if (!lpLedger->hasAccount (raAccount))
|
||||||
return rpcError (rpcACT_NOT_FOUND);
|
return rpcError (rpcACT_NOT_FOUND);
|
||||||
|
|
||||||
boost::shared_ptr<Json::Value> jvsOffers =
|
Json::Value& jvsOffers = (jvResult["offers"] = Json::arrayValue);
|
||||||
theApp->getOPs ().getJSONCache (JSONCache::kindOffers, lpLedger->getHash (), raAccount.getAccountID ());
|
lpLedger->visitAccountItems (raAccount.getAccountID (), BIND_TYPE (&offerAdder, boost::ref (jvsOffers), P_1));
|
||||||
|
|
||||||
if (!jvsOffers)
|
|
||||||
{
|
|
||||||
jvsOffers = boost::make_shared<Json::Value> (Json::arrayValue);
|
|
||||||
lpLedger->visitAccountItems (raAccount.getAccountID (), BIND_TYPE (&offerAdder, boost::ref (*jvsOffers), P_1));
|
|
||||||
theApp->getOPs ().storeJSONCache (JSONCache::kindOffers, lpLedger->getHash (), raAccount.getAccountID (), jvsOffers);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bUnlocked)
|
if (!bUnlocked)
|
||||||
MasterLockHolder.unlock ();
|
MasterLockHolder.unlock ();
|
||||||
|
|
||||||
jvResult["offers"] = *jvsOffers;
|
|
||||||
|
|
||||||
return jvResult;
|
return jvResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user