From 91d8bcfed5c6d5c579dab2aae5af0521a1589954 Mon Sep 17 00:00:00 2001 From: Anthony Fieroni Date: Tue, 25 Jan 2022 14:09:36 +0000 Subject: [PATCH] Cleanups + indentation (#1063) Signed-off-by: Anthony Fieroni --- src/masternodes/masternodes.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/masternodes/masternodes.cpp b/src/masternodes/masternodes.cpp index 86b528af9c..54d3bfe875 100644 --- a/src/masternodes/masternodes.cpp +++ b/src/masternodes/masternodes.cpp @@ -922,16 +922,16 @@ CAmount CCollateralLoans::precisionRatio() const ResVal CCustomCSView::GetAmountInCurrency(CAmount amount, CTokenCurrencyPair priceFeedId, bool useNextPrice, bool requireLivePrice) { - auto priceResult = GetValidatedIntervalPrice(priceFeedId, useNextPrice, requireLivePrice); - if (!priceResult) - return std::move(priceResult); + auto priceResult = GetValidatedIntervalPrice(priceFeedId, useNextPrice, requireLivePrice); + if (!priceResult) + return priceResult; - auto price = priceResult.val.get(); - auto amountInCurrency = MultiplyAmounts(price, amount); - if (price > COIN && amountInCurrency < amount) - return Res::Err("Value/price too high (%s/%s)", GetDecimaleString(amount), GetDecimaleString(price)); + auto price = *priceResult.val; + auto amountInCurrency = MultiplyAmounts(price, amount); + if (price > COIN && amountInCurrency < amount) + return Res::Err("Value/price too high (%s/%s)", GetDecimaleString(amount), GetDecimaleString(price)); - return ResVal(amountInCurrency, Res::Ok()); + return ResVal(amountInCurrency, Res::Ok()); } ResVal CCustomCSView::GetLoanCollaterals(CVaultId const& vaultId, CBalances const& collaterals, uint32_t height,