@@ -178,12 +178,12 @@ bool CheckInputScripts(const CTransaction& tx, TxValidationState& state,
178178 std::vector<CScriptCheck>* pvChecks = nullptr )
179179 EXCLUSIVE_LOCKS_REQUIRED(cs_main);
180180
181- bool CheckFinalTx (const CBlockIndex* active_chain_tip, const CTransaction& tx)
181+ bool CheckFinalTxAtTip (const CBlockIndex* active_chain_tip, const CTransaction& tx)
182182{
183183 AssertLockHeld (cs_main);
184184 assert (active_chain_tip); // TODO: Make active_chain_tip a reference
185185
186- // CheckFinalTx () uses active_chain_tip.Height()+1 to evaluate
186+ // CheckFinalTxAtTip () uses active_chain_tip.Height()+1 to evaluate
187187 // nLockTime because when IsFinalTx() is called within
188188 // AcceptBlock(), the height of the block *being*
189189 // evaluated is what is used. Thus if we want to know if a
@@ -201,7 +201,7 @@ bool CheckFinalTx(const CBlockIndex* active_chain_tip, const CTransaction& tx)
201201 return IsFinalTx (tx, nBlockHeight, nBlockTime);
202202}
203203
204- bool CheckSequenceLocks (CBlockIndex* tip,
204+ bool CheckSequenceLocksAtTip (CBlockIndex* tip,
205205 const CCoinsView& coins_view,
206206 const CTransaction& tx,
207207 LockPoints* lp,
@@ -211,7 +211,7 @@ bool CheckSequenceLocks(CBlockIndex* tip,
211211
212212 CBlockIndex index;
213213 index.pprev = tip;
214- // CheckSequenceLocks () uses active_chainstate.m_chain.Height()+1 to evaluate
214+ // CheckSequenceLocksAtTip () uses active_chainstate.m_chain.Height()+1 to evaluate
215215 // height based locks because when SequenceLocks() is called within
216216 // ConnectBlock(), the height of the block *being*
217217 // evaluated is what is used.
@@ -257,7 +257,7 @@ bool CheckSequenceLocks(CBlockIndex* tip,
257257 // lockPair from CalculateSequenceLocks against tip+1. We know
258258 // EvaluateSequenceLocks will fail if there was a non-zero sequence
259259 // lock on a mempool input, so we can use the return value of
260- // CheckSequenceLocks to indicate the LockPoints validity
260+ // CheckSequenceLocksAtTip to indicate the LockPoints validity
261261 int maxInputHeight = 0 ;
262262 for (const int height : prevheights) {
263263 // Can ignore mempool inputs since we'll fail if they had non-zero locks
@@ -352,19 +352,19 @@ void CChainState::MaybeUpdateMempoolForReorg(
352352 const CTransaction& tx = it->GetTx ();
353353
354354 // The transaction must be final.
355- if (!CheckFinalTx (m_chain.Tip (), tx)) return true ;
355+ if (!CheckFinalTxAtTip (m_chain.Tip (), tx)) return true ;
356356 LockPoints lp = it->GetLockPoints ();
357357 const bool validLP{TestLockPointValidity (m_chain, lp)};
358358 CCoinsViewMemPool view_mempool (&CoinsTip (), *m_mempool);
359- // CheckSequenceLocks checks if the transaction will be final in the next block to be
359+ // CheckSequenceLocksAtTip checks if the transaction will be final in the next block to be
360360 // created on top of the new chain. We use useExistingLockPoints=false so that, instead of
361361 // using the information in lp (which might now refer to a block that no longer exists in
362362 // the chain), it will update lp to contain LockPoints relevant to the new chain.
363- if (!CheckSequenceLocks (m_chain.Tip (), view_mempool, tx, &lp, validLP)) {
364- // If CheckSequenceLocks fails, remove the tx and don't depend on the LockPoints.
363+ if (!CheckSequenceLocksAtTip (m_chain.Tip (), view_mempool, tx, &lp, validLP)) {
364+ // If CheckSequenceLocksAtTip fails, remove the tx and don't depend on the LockPoints.
365365 return true ;
366366 } else if (!validLP) {
367- // If CheckSequenceLocks succeeded, it also updated the LockPoints.
367+ // If CheckSequenceLocksAtTip succeeded, it also updated the LockPoints.
368368 // Now update the mempool entry lockpoints as well.
369369 m_mempool->mapTx .modify (it, [&lp](CTxMemPoolEntry& e) { e.UpdateLockPoints (lp); });
370370 }
@@ -688,7 +688,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
688688 // Only accept nLockTime-using transactions that can be mined in the next
689689 // block; we don't want our mempool filled up with transactions that can't
690690 // be mined yet.
691- if (!CheckFinalTx (m_active_chainstate.m_chain .Tip (), tx)) {
691+ if (!CheckFinalTxAtTip (m_active_chainstate.m_chain .Tip (), tx)) {
692692 return state.Invalid (TxValidationResult::TX_PREMATURE_SPEND, " non-final" );
693693 }
694694
@@ -770,7 +770,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
770770 // be mined yet.
771771 // Pass in m_view which has all of the relevant inputs cached. Note that, since m_view's
772772 // backend was removed, it no longer pulls coins from the mempool.
773- if (!CheckSequenceLocks (m_active_chainstate.m_chain .Tip (), m_view, tx, &lp)) {
773+ if (!CheckSequenceLocksAtTip (m_active_chainstate.m_chain .Tip (), m_view, tx, &lp)) {
774774 return state.Invalid (TxValidationResult::TX_PREMATURE_SPEND, " non-BIP68-final" );
775775 }
776776
0 commit comments