From e306a7c75f04156e44897b04cd4940355788e88f Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Thu, 23 Oct 2025 14:11:31 -0400 Subject: [PATCH] Fix some build errors --- src/xrpld/app/misc/LendingHelpers.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/xrpld/app/misc/LendingHelpers.h b/src/xrpld/app/misc/LendingHelpers.h index f15402cc83..ab86f841d8 100644 --- a/src/xrpld/app/misc/LendingHelpers.h +++ b/src/xrpld/app/misc/LendingHelpers.h @@ -865,14 +865,18 @@ computeLatePayment( XRPL_ASSERT( roundedLateInterest >= 0, "ripple::detail::computeLatePayment : valid late interest"); + XRPL_ASSERT_PARTS( + periodic.specialCase != SpecialCase::extra, + "ripple::detail::computeLatePayment", + "no extra parts to this payment"); + // Copy the periodic payment values, and add on the late interest. + // This preserves all the other fields without having to enumerate them. + PaymentComponents inner = periodic; + inner.rawInterest += rawLateInterest; + inner.roundedInterest += roundedLateInterest; + PaymentComponentsPlus const late{ - PaymentComponents{ - .rawInterest = periodic.rawInterest + rawLateInterest, - .rawPrincipal = periodic.rawPrincipal, - .rawManagementFee = periodic.rawManagementFee, - .roundedInterest = periodic.roundedInterest + roundedLateInterest, - .roundedPrincipal = periodic.roundedPrincipal, - .roundedManagementFee = periodic.roundedManagementFee}, + inner, // A late payment pays both the normal fee, and the extra fees periodic.extraFee + latePaymentFee + roundedLateManagementFee, // A late payment increases the value of the loan by the difference @@ -1575,7 +1579,6 @@ loanMakePayment( auto const periodicPayment = loan->at(sfPeriodicPayment); auto prevPaymentDateProxy = loan->at(sfPreviousPaymentDate); - std::uint32_t const startDate = loan->at(sfStartDate); std::uint32_t const paymentInterval = loan->at(sfPaymentInterval); // Compute the normal periodic rate, payment, etc.