From b6e8fe84e7c3277f4df1ea34bd87121ad5ef1983 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Fri, 27 May 2022 10:08:39 +0530 Subject: [PATCH] Make linter happy --- src/validation.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/validation.cpp b/src/validation.cpp index 5de2ad7e23..3caf49f20f 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4086,10 +4086,10 @@ static Res PoolSplits(CCustomCSView& view, CAmount& totalBalance, ATTRIBUTES& at continue; } - LogPrint(BCLog::TOKEN_SPLIT, "TokenSplit: LP (%s: %s => %s)\n", - ScriptToString(owner), - CTokenAmount{oldPoolId, amount}.ToString(), - CTokenAmount{newPoolId, liquidity}.ToString()); + auto oldPoolLogStr = CTokenAmount{oldPoolId, amount}.ToString(); + auto newPoolLogStr = CTokenAmount{newPoolId, liquidity}.ToString(); + LogPrint(BCLog::TOKEN_SPLIT, "TokenSplit: LP (%s: %s => %s)\n", + ScriptToString(owner), oldPoolLogStr, newPoolLogStr); view.SetShare(newPoolId, owner, pindex->nHeight); } @@ -4381,12 +4381,14 @@ void CChainState::ProcessTokenSplits(const CBlock& block, const CBlockIndex* pin view.ForEachBalance([&, multiplier = multiplier](CScript const& owner, const CTokenAmount& balance) { if (oldTokenId.v == balance.nTokenId.v) { const auto newBalance = CalculateNewAmount(multiplier, balance.nValue); - LogPrint(BCLog::TOKEN_SPLIT, "TokenSplit: T (%s, v: %s => %s)\n", - ScriptToString(owner), balance.ToString(), - CTokenAmount{newTokenId, newBalance}.ToString()); addAccounts[owner].Add({newTokenId, newBalance}); subAccounts[owner].Add(balance); totalBalance += newBalance; + + auto newBalanceStr = CTokenAmount{newTokenId, newBalance}.ToString(); + LogPrint(BCLog::TOKEN_SPLIT, "TokenSplit: T (%s, v: %s => %s)\n", + ScriptToString(owner), balance.ToString(), + newBalanceStr); } return true; });