fix: improve docs

This commit is contained in:
Vito
2026-08-13 13:58:15 +02:00
parent 74102450a8
commit 58e459a4a0

View File

@@ -188,6 +188,11 @@ LoanManage::defaultLoan(
// required to paper over the resulting cross-side mismatch -- a snap
// that itself minted phantom assets on sfAssetsTotal. See the
// sibling change in LoanPay for the same fix on the payment path.
//
// The Number-precision guard `T - A >= totalDefaultAmount` below is
// exactly sufficient: loanVaultExposure returns a difference of vault-
// associated STNumber fields (IOU-normalized via associateAsset), so
// its STAmount promotion round-trips losslessly with no writeOff slack.
bool const useUnifiedAssetArithmetic = view.rules().enabled(fixCleanup3_4_0);
if (useUnifiedAssetArithmetic)
@@ -224,6 +229,11 @@ LoanManage::defaultLoan(
vaultSle->at(sfAssetsTotal) += amount - writeOff;
vaultSle->at(sfAssetsAvailable) += amount;
XRPL_ASSERT_PARTS(
*vaultSle->at(sfAssetsAvailable) <= *vaultSle->at(sfAssetsTotal),
"xrpl::LoanManage::defaultLoan",
"assets available must not be greater than assets outstanding");
}
else
{