diff options
author | glozow <gloriajzhao@gmail.com> | 2021-12-02 11:47:20 +0000 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2021-12-02 12:04:17 +0000 |
commit | b01784f0270dc20f8076ea4e46203c97b40b93ef (patch) | |
tree | 74363de404894c2b42356171b4fcd1b88cc3a6dc /src/validation.cpp | |
parent | 6acda4b00b3fc1bfac02f5de590e1a5386cbc779 (diff) |
remove unnecessary casts and use braced initialization
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 6ed5e7a548..1a4837839e 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -357,7 +357,7 @@ void CChainState::MaybeUpdateMempoolForReorg( AssertLockHeld(::cs_main); const CTransaction& tx = it->GetTx(); LockPoints lp = it->GetLockPoints(); - bool validLP = TestLockPointValidity(m_chain, &lp); + const bool validLP{TestLockPointValidity(m_chain, &lp)}; CCoinsViewMemPool view_mempool(&CoinsTip(), *m_mempool); if (!CheckFinalTx(m_chain.Tip(), tx, flags) || !CheckSequenceLocks(m_chain.Tip(), view_mempool, tx, flags, &lp, validLP)) { @@ -371,8 +371,8 @@ void CChainState::MaybeUpdateMempoolForReorg( continue; const Coin &coin = CoinsTip().AccessCoin(txin.prevout); assert(!coin.IsSpent()); - unsigned int nMemPoolHeight = m_chain.Tip()->nHeight + 1; - if (coin.IsSpent() || (coin.IsCoinBase() && ((signed long)nMemPoolHeight) - coin.nHeight < COINBASE_MATURITY)) { + const auto mempool_spend_height{m_chain.Tip()->nHeight + 1}; + if (coin.IsSpent() || (coin.IsCoinBase() && mempool_spend_height - coin.nHeight < COINBASE_MATURITY)) { should_remove = true; break; } |