Refactor MetaView (RIPD-954):

Obsolete functionality is removed. DeferredCredits is moved
to a new class PaymentView, and used in RippleCalc.
This commit is contained in:
Vinnie Falco
2015-06-24 05:07:20 -07:00
parent f535304e1b
commit 48d6a4ab6a
53 changed files with 651 additions and 782 deletions

View File

@@ -483,8 +483,9 @@ Json::Value PathRequest::doUpdate (RippleLineCache::ref cache, bool fast)
if (valid)
{
MetaView sandbox(
cache->getLedger(), tapNONE);
boost::optional<PaymentView> sandbox;
sandbox.emplace(cache->getLedger(), tapNONE);
auto& sourceAccount = !isXRP (currIssuer.account)
? currIssuer.account
: isXRP (currIssuer.currency)
@@ -496,7 +497,7 @@ Json::Value PathRequest::doUpdate (RippleLineCache::ref cache, bool fast)
m_journal.debug << iIdentifier
<< " Paths found, calling rippleCalc";
auto rc = path::RippleCalc::rippleCalculate (
sandbox,
*sandbox,
saMaxAmount,
saDstAmount,
*raDstAccount,
@@ -509,9 +510,9 @@ Json::Value PathRequest::doUpdate (RippleLineCache::ref cache, bool fast)
m_journal.debug
<< iIdentifier << " Trying with an extra path element";
spsPaths.push_back (fullLiquidityPath);
reconstruct(sandbox, cache->getLedger (), tapNONE);
sandbox.emplace(cache->getLedger (), tapNONE);
rc = path::RippleCalc::rippleCalculate (
sandbox,
*sandbox,
saMaxAmount,
saDstAmount,
*raDstAccount,