From fc338b0e50eed73b04fc95b2079ed6b6605e53bd Mon Sep 17 00:00:00 2001 From: Anthony Fieroni Date: Tue, 25 Jan 2022 16:01:27 +0200 Subject: [PATCH] Cleanups + indentation 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 86b528af9c0..54d3bfe8755 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,