From 04c141cba54d55fcb89a927a31060b066a2f450d Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 18 Mar 2026 17:35:58 -0400 Subject: [PATCH] fix reversed naming of variables --- include/xrpl/ledger/PaymentSandbox.h | 4 ++-- src/libxrpl/ledger/PaymentSandbox.cpp | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/xrpl/ledger/PaymentSandbox.h b/include/xrpl/ledger/PaymentSandbox.h index 891e3ef27b..95c737e295 100644 --- a/include/xrpl/ledger/PaymentSandbox.h +++ b/include/xrpl/ledger/PaymentSandbox.h @@ -58,8 +58,8 @@ private: { explicit Value() = default; - STAmount lowAcctCredits; - STAmount highAcctCredits; + STAmount lowAcctDebits; + STAmount highAcctDebits; STAmount lowAcctOrigBalance; }; diff --git a/src/libxrpl/ledger/PaymentSandbox.cpp b/src/libxrpl/ledger/PaymentSandbox.cpp index 1f84da1dcb..5da48abf0d 100644 --- a/src/libxrpl/ledger/PaymentSandbox.cpp +++ b/src/libxrpl/ledger/PaymentSandbox.cpp @@ -37,14 +37,14 @@ DeferredCredits::credit( if (sender < receiver) { - v.highAcctCredits = amount; - v.lowAcctCredits = amount.zeroed(); + v.lowAcctDebits = amount; + v.highAcctDebits = amount.zeroed(); v.lowAcctOrigBalance = preCreditSenderBalance; } else { - v.highAcctCredits = amount.zeroed(); - v.lowAcctCredits = amount; + v.lowAcctDebits = amount.zeroed(); + v.highAcctDebits = amount; v.lowAcctOrigBalance = -preCreditSenderBalance; } @@ -56,11 +56,11 @@ DeferredCredits::credit( auto& v = i->second; if (sender < receiver) { - v.highAcctCredits += amount; + v.lowAcctDebits += amount; } else { - v.lowAcctCredits += amount; + v.highAcctDebits += amount; } } } @@ -104,11 +104,11 @@ DeferredCredits::adjustments( if (main < other) { - result.emplace(v.highAcctCredits, v.lowAcctCredits, v.lowAcctOrigBalance); + result.emplace(v.lowAcctDebits, v.highAcctDebits, v.lowAcctOrigBalance); return result; } - result.emplace(v.lowAcctCredits, v.highAcctCredits, -v.lowAcctOrigBalance); + result.emplace(v.highAcctDebits, v.lowAcctDebits, -v.lowAcctOrigBalance); return result; } @@ -122,8 +122,8 @@ DeferredCredits::apply(DeferredCredits& to) { auto& toVal = r.first->second; auto const& fromVal = i.second; - toVal.lowAcctCredits += fromVal.lowAcctCredits; - toVal.highAcctCredits += fromVal.highAcctCredits; + toVal.lowAcctDebits += fromVal.lowAcctDebits; + toVal.highAcctDebits += fromVal.highAcctDebits; // Do not update the orig balance, it's already correct } }