mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-07 18:56:47 +00:00
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.
This commit is contained in:
@@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user