mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-21 22:30:57 +00:00
fix: improve docs
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user