Skip to content

Commit

Permalink
Cleanups + indentation (#1063)
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony Fieroni <[email protected]>
  • Loading branch information
bvbfan authored Jan 25, 2022
1 parent 2148a9b commit 91d8bcf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/masternodes/masternodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,16 +922,16 @@ CAmount CCollateralLoans::precisionRatio() const

ResVal<CAmount> 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<CAmount>(amountInCurrency, Res::Ok());
return ResVal<CAmount>(amountInCurrency, Res::Ok());
}

ResVal<CCollateralLoans> CCustomCSView::GetLoanCollaterals(CVaultId const& vaultId, CBalances const& collaterals, uint32_t height,
Expand Down

0 comments on commit 91d8bcf

Please sign in to comment.