aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-12-03 12:07:57 +0800
committerfanquake <fanquake@gmail.com>2021-12-03 12:20:46 +0800
commitffe414bd9a9c510907da759a170a291915f138f2 (patch)
treed4bafaa3c1daed418ff86d980415073d5ff573f5 /src/validation.cpp
parent0b30bdd519ae06ec70e136a1b890421eb6f764cc (diff)
parentddd74ff65c471c5c25815ac0643d16ea0d51f58f (diff)
Merge bitcoin/bitcoin#23649: circular dependency followups
ddd74ff65c471c5c25815ac0643d16ea0d51f58f clean up txmempool includes (glozow) c4efc4db5484910ac33ba41aa76f4e23639d6f33 change TestLockPointValidity to take a const reference (glozow) b01784f0270dc20f8076ea4e46203c97b40b93ef remove unnecessary casts and use braced initialization (glozow) Pull request description: Followups from #22677 + clean up `TestLockPointValidity` ACKs for top commit: theStack: Code-review ACK ddd74ff65c471c5c25815ac0643d16ea0d51f58f Tree-SHA512: 0f7f26535b7301e2fb379e676310bdc7cfb2c5e232a6657f41dc6d3bc91583ec452eb2359ad2f2416ea12dd856f7fab3fa507a391ccf80f14de96da989281d96
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 6ed5e7a548..b532888f37 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;
}