mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 03:26:01 +00:00
moves Loandelta function to a better place
This commit is contained in:
@@ -68,6 +68,17 @@ isRounded(Asset const& asset, Number const& value, std::int32_t scale)
|
|||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
|
void
|
||||||
|
LoanDeltas::nonNegative()
|
||||||
|
{
|
||||||
|
if (principal < beast::zero)
|
||||||
|
principal = numZero;
|
||||||
|
if (interest < beast::zero)
|
||||||
|
interest = numZero;
|
||||||
|
if (managementFee < beast::zero)
|
||||||
|
managementFee = numZero;
|
||||||
|
}
|
||||||
|
|
||||||
/* Computes (1 + periodicRate)^paymentsRemaining for amortization calculations.
|
/* Computes (1 + periodicRate)^paymentsRemaining for amortization calculations.
|
||||||
*
|
*
|
||||||
* Equation (5) from XLS-66 spec, Section A-2 Equation Glossary
|
* Equation (5) from XLS-66 spec, Section A-2 Equation Glossary
|
||||||
@@ -884,17 +895,11 @@ PaymentComponents::trackedInterestPart() const
|
|||||||
(trackedPrincipalDelta + trackedManagementFeeDelta);
|
(trackedPrincipalDelta + trackedManagementFeeDelta);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
PaymentComponents
|
||||||
LoanDeltas::nonNegative()
|
computePaymentComponents(
|
||||||
{
|
Asset const& asset,
|
||||||
if (principal < beast::zero)
|
std::int32_t scale,
|
||||||
principal = numZero;
|
Number const& totalValueOutstanding,
|
||||||
if (interest < beast::zero)
|
|
||||||
interest = numZero;
|
|
||||||
if (managementFee < beast::zero)
|
|
||||||
managementFee = numZero;
|
|
||||||
}
|
|
||||||
|
|
||||||
PaymentComponents
|
PaymentComponents
|
||||||
computePaymentComponents(
|
computePaymentComponents(
|
||||||
Asset const& asset,
|
Asset const& asset,
|
||||||
|
|||||||
Reference in New Issue
Block a user