diff --git a/include/xrpl/protocol/STAmount.h b/include/xrpl/protocol/STAmount.h index c17b74f113..8217c21a32 100644 --- a/include/xrpl/protocol/STAmount.h +++ b/include/xrpl/protocol/STAmount.h @@ -772,6 +772,10 @@ roundToAsset( return roundToScale(ret, scale); } +/* Checks if a value is already rounded to the specified scale. + * Returns true if rounding down and rounding up produce the same result, + * indicating no further precision exists beyond the scale. + */ [[nodiscard]] inline bool isRounded(Asset const& asset, Number const& value, std::int32_t scale) { diff --git a/src/libxrpl/ledger/helpers/VaultHelpers.cpp b/src/libxrpl/ledger/helpers/VaultHelpers.cpp index 769e50149b..09cdb2edea 100644 --- a/src/libxrpl/ledger/helpers/VaultHelpers.cpp +++ b/src/libxrpl/ledger/helpers/VaultHelpers.cpp @@ -307,7 +307,7 @@ removeVaultAssets( applyRemoveVaultAssets(ctx.view, vault, amount, finalRemoval); if (amount == beast::kZero) - return tesSUCCESS; + return tesSUCCESS; // LCOV_EXCL_LINE return doWithdraw(ctx, senderAcct, dstAcct, vault->at(sfAccount), priorBalance, amount, j); } diff --git a/src/libxrpl/tx/transactors/lending/LoanManage.cpp b/src/libxrpl/tx/transactors/lending/LoanManage.cpp index 76a3060b25..b3e02c5a5e 100644 --- a/src/libxrpl/tx/transactors/lending/LoanManage.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanManage.cpp @@ -271,17 +271,13 @@ LoanManage::defaultLoan( // Update the Vault's assets, and return funds from the LoanBroker // pseudo-account to the Vault pseudo-account: - if (auto const ter = addVaultAssets( - view, - vaultSle, - brokerSle->at(sfAccount), - STAmount{vaultAsset, defaultCovered}, - STAmount{vaultAsset, vaultTotalDelta}, - j); - !isTesSuccess(ter)) - return ter; - - return tesSUCCESS; + return addVaultAssets( + view, + vaultSle, + brokerSle->at(sfAccount), + STAmount{vaultAsset, defaultCovered}, + STAmount{vaultAsset, vaultTotalDelta}, + j); } TER