We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27200ab commit d258a0cCopy full SHA for d258a0c
src/xrpld/app/tx/detail/LoanPay.cpp
@@ -109,8 +109,9 @@ LoanPay::calculateBaseFee(ReadView const& view, STTx const& tx)
109
NumberRoundModeGuard mg(
110
tx.isFlag(tfLoanOverpayment) ? Number::upward : Number::downward);
111
// Estimate how many payments will be made
112
- Number const numPaymentEstimate =
113
- static_cast<std::int64_t>(amount / regularPayment);
+ Number const numPaymentEstimate = std::min(
+ static_cast<std::int64_t>(amount / regularPayment),
114
+ Lending::loanMaximumPaymentsPerTransaction);
115
116
// Charge one base fee per paymentsPerFeeIncrement payments, rounding up.
117
Number::setround(Number::upward);
0 commit comments