Skip to content

Commit b01784f

Browse files
committed
remove unnecessary casts and use braced initialization
1 parent 6acda4b commit b01784f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/validation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ void CChainState::MaybeUpdateMempoolForReorg(
357357
AssertLockHeld(::cs_main);
358358
const CTransaction& tx = it->GetTx();
359359
LockPoints lp = it->GetLockPoints();
360-
bool validLP = TestLockPointValidity(m_chain, &lp);
360+
const bool validLP{TestLockPointValidity(m_chain, &lp)};
361361
CCoinsViewMemPool view_mempool(&CoinsTip(), *m_mempool);
362362
if (!CheckFinalTx(m_chain.Tip(), tx, flags)
363363
|| !CheckSequenceLocks(m_chain.Tip(), view_mempool, tx, flags, &lp, validLP)) {
@@ -371,8 +371,8 @@ void CChainState::MaybeUpdateMempoolForReorg(
371371
continue;
372372
const Coin &coin = CoinsTip().AccessCoin(txin.prevout);
373373
assert(!coin.IsSpent());
374-
unsigned int nMemPoolHeight = m_chain.Tip()->nHeight + 1;
375-
if (coin.IsSpent() || (coin.IsCoinBase() && ((signed long)nMemPoolHeight) - coin.nHeight < COINBASE_MATURITY)) {
374+
const auto mempool_spend_height{m_chain.Tip()->nHeight + 1};
375+
if (coin.IsSpent() || (coin.IsCoinBase() && mempool_spend_height - coin.nHeight < COINBASE_MATURITY)) {
376376
should_remove = true;
377377
break;
378378
}

0 commit comments

Comments
 (0)