From 663229cfdfb5d2da0cb8beac43528f7d5710b681 Mon Sep 17 00:00:00 2001 From: Vito <5780819+Tapanito@users.noreply.github.com> Date: Tue, 22 Sep 2026 16:25:25 +0200 Subject: [PATCH] fix: Rename LendingHelpers' liveScale to avoid unity-build clash VaultHelpers.cpp defines its own file-local liveScale with the same signature. Under -Dunity=ON the ledger module batches sources in groups of 15, so the two anonymous-namespace helpers can land in the same translation unit and collide. --- src/libxrpl/ledger/helpers/LendingHelpers.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libxrpl/ledger/helpers/LendingHelpers.cpp b/src/libxrpl/ledger/helpers/LendingHelpers.cpp index f704dc8a68..05da0b8323 100644 --- a/src/libxrpl/ledger/helpers/LendingHelpers.cpp +++ b/src/libxrpl/ledger/helpers/LendingHelpers.cpp @@ -38,7 +38,7 @@ namespace xrpl { namespace { [[nodiscard]] int -liveScale(Number const& reference, Asset const& asset, int baseScale) +liveCoverScale(Number const& reference, Asset const& asset, int baseScale) { if (reference == beast::kZero) return baseScale; @@ -93,7 +93,7 @@ getBrokerCoverScale(SLE::const_ref vault, SLE::const_ref broker) case VaultVersion::CashBasis: return scale(broker->at(sfCoverAvailable), vault->at(sfAsset)); case VaultVersion::FixedPrecision: - return liveScale( + return liveCoverScale( broker->at(sfCoverAvailable), vault->at(sfAsset), getVaultBaseScale(vault)); } // LCOV_EXCL_START @@ -126,7 +126,7 @@ getPosteriorBrokerCoverScale(SLE::const_ref vault, SLE::const_ref broker, STAmou case VaultVersion::CashBasis: return scale(posterior, vault->at(sfAsset)); case VaultVersion::FixedPrecision: - return liveScale(posterior, vault->at(sfAsset), getVaultBaseScale(vault)); + return liveCoverScale(posterior, vault->at(sfAsset), getVaultBaseScale(vault)); } // LCOV_EXCL_START UNREACHABLE("xrpl::getPosteriorBrokerCoverScale : valid VaultVersion");