Use last closed ledger for old pathfinding

This commit is contained in:
David Schwartz
2014-05-07 17:57:51 -07:00
committed by Nik Bougalis
parent 6339800946
commit aaabec0b55

View File

@@ -90,13 +90,16 @@ Json::Value RPCHandler::doRipplePathFind (Json::Value params, Resource::Charge&
RippleLineCache::pointer cache;
if (lpLedger)
{ // The caller specified a ledger
{
// The caller specified a ledger
lpLedger = boost::make_shared<Ledger> (boost::ref (*lpLedger), false);
cache = boost::make_shared<RippleLineCache>(lpLedger);
}
else
{ // Use the default ledger and cache
lpLedger = mNetOps->getValidatedLedger();
{
// The closed ledger is recent and any nodes made resident
// have the best chance to persist
lpLedger = mNetOps->getClosedLedger();
cache = getApp().getPathRequests().getLineCache(lpLedger, false);
}