From 947ad002e0dd6e64d760b08cb209b644bbd99286 Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Wed, 3 Dec 2025 18:35:25 -0500 Subject: [PATCH] Review feedback from @Tapanito: overpayment value change - In overpayment results, the management fee was being calculated twice: once as part of the value change, and as part of the fees paid. Exclude it from the value change. --- src/xrpld/app/misc/detail/LendingHelpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xrpld/app/misc/detail/LendingHelpers.cpp b/src/xrpld/app/misc/detail/LendingHelpers.cpp index 8020b47ba9..cb75444a90 100644 --- a/src/xrpld/app/misc/detail/LendingHelpers.cpp +++ b/src/xrpld/app/misc/detail/LendingHelpers.cpp @@ -553,8 +553,8 @@ tryOverpayment( // Calculate how the loan's value changed due to the overpayment. // This should be negative (value decreased) or zero. A principal // overpayment should never increase the loan's value. - auto const valueChange = - newRounded.valueOutstanding - hypotheticalValueOutstanding; + auto const valueChange = newRounded.valueOutstanding - + hypotheticalValueOutstanding - deltas.managementFee; if (valueChange > 0) { JLOG(j.warn()) << "Principal overpayment would increase the value of "