Break the ripple line cache into its own structure

This commit is contained in:
JoelKatz
2013-04-30 15:57:11 -07:00
parent 297f68f371
commit 9df93f4202
3 changed files with 27 additions and 10 deletions

View File

@@ -180,7 +180,8 @@ Json::Value RPCHandler::transactionSign(Json::Value jvRequest, bool bSubmit)
{
ScopedUnlock su(theApp->getMasterLock());
bool bValid;
Pathfinder pf(lSnapshot, raSrcAddressID, dstAccountID,
RLCache::pointer cache = boost::make_shared<RLCache>(lSnapshot);
Pathfinder pf(lSnapshot, cache, raSrcAddressID, dstAccountID,
saSendMax.getCurrency(), saSendMax.getIssuer(), saSend, bValid);
if (!bValid || !pf.findPaths(theConfig.PATH_SEARCH_SIZE, 3, spsPaths))
@@ -1304,6 +1305,7 @@ Json::Value RPCHandler::doRipplePathFind(Json::Value jvRequest, int& cost, Scope
jvResult["destination_account"] = raDst.humanAccountID();
Json::Value jvArray(Json::arrayValue);
RLCache::pointer cache = boost::make_shared<RLCache>(lSnapShot);
for (unsigned int i=0; i != jvSrcCurrencies.size(); ++i) {
Json::Value jvSource = jvSrcCurrencies[i];
@@ -1339,7 +1341,7 @@ Json::Value RPCHandler::doRipplePathFind(Json::Value jvRequest, int& cost, Scope
STPathSet spsComputed;
bool bValid;
Pathfinder pf(lSnapShot, raSrc, raDst, uSrcCurrencyID, uSrcIssuerID, saDstAmount, bValid);
Pathfinder pf(lSnapShot, cache, raSrc, raDst, uSrcCurrencyID, uSrcIssuerID, saDstAmount, bValid);
if (!bValid || !pf.findPaths(theConfig.PATH_SEARCH_SIZE, 3, spsComputed))
{