mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Refactor View classes:
The View hierarchy of classes is reorganized to include new classes with member functions moved and renamed, to solve defects in the original design: OpenView accumulates raw state and tx changes and can be applied to the base. ApplyView accumulates changes for a single transaction, including metadata, and can be applied to an OpenView. The Sandbox allows changes with the option to apply or throw them out. The PaymentSandbox provides a sandbox with account credit deferral. Call sites are changed to use the class appropriate for the task.
This commit is contained in:
@@ -522,9 +522,8 @@ Json::Value PathRequest::doUpdate (RippleLineCache::ref cache, bool fast)
|
||||
|
||||
if (valid)
|
||||
{
|
||||
boost::optional<PaymentView> sandbox;
|
||||
sandbox.emplace(*cache->getLedger(),
|
||||
tapNONE);
|
||||
boost::optional<PaymentSandbox> sandbox;
|
||||
sandbox.emplace(&*cache->getLedger(), tapNONE);
|
||||
|
||||
auto& sourceAccount = !isXRP (currIssuer.account)
|
||||
? currIssuer.account
|
||||
@@ -550,8 +549,7 @@ Json::Value PathRequest::doUpdate (RippleLineCache::ref cache, bool fast)
|
||||
m_journal.debug
|
||||
<< iIdentifier << " Trying with an extra path element";
|
||||
spsPaths.push_back (fullLiquidityPath);
|
||||
sandbox.emplace(*cache->getLedger(),
|
||||
tapNONE);
|
||||
sandbox.emplace(&*cache->getLedger(), tapNONE);
|
||||
rc = path::RippleCalc::rippleCalculate (
|
||||
*sandbox,
|
||||
saMaxAmount,
|
||||
|
||||
Reference in New Issue
Block a user