Skip to content

Commit 0ccf9b2

Browse files
committed
Merge bitcoin/bitcoin#23258: doc: Fix outdated comments referring to ::ChainActive()
a0efe52 Fix outdated comments referring to ::ChainActive() (Samuel Dobson) Pull request description: After #21866 there are a few outdated comments referring to `::ChainActive()`, which should instead refer to `ChainstateManager::ActiveChain()`. ACKs for top commit: jamesob: ACK bitcoin/bitcoin@a0efe52 Tree-SHA512: 80da19c105ed29ac247e6df4c8e916c3bf3f37230b63f07302114eef9c115add673e9649f0bbe237295be0c6da7b1030b5b93e14daf6768f17ce5de7cf2c9ff2
2 parents a7f28af + a0efe52 commit 0ccf9b2

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/index/base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ bool BaseIndex::BlockUntilSyncedToCurrentChain() const
321321

322322
{
323323
// Skip the queue-draining stuff if we know we're caught up with
324-
// ::ChainActive().Tip().
324+
// m_chain.Tip().
325325
LOCK(cs_main);
326326
const CBlockIndex* chain_tip = m_chainstate->m_chain.Tip();
327327
const CBlockIndex* best_block_index = m_best_block_index.load();

src/policy/fees.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, boo
549549
if (txHeight != nBestSeenHeight) {
550550
// Ignore side chains and re-orgs; assuming they are random they don't
551551
// affect the estimate. We'll potentially double count transactions in 1-block reorgs.
552-
// Ignore txs if BlockPolicyEstimator is not in sync with ::ChainActive().Tip().
552+
// Ignore txs if BlockPolicyEstimator is not in sync with ActiveChain().Tip().
553553
// It will be synced next time a block is processed.
554554
return;
555555
}

src/txmempool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ class CTxMemPool
542542
* By design, it is guaranteed that:
543543
*
544544
* 1. Locking both `cs_main` and `mempool.cs` will give a view of mempool
545-
* that is consistent with current chain tip (`::ChainActive()` and
545+
* that is consistent with current chain tip (`ActiveChain()` and
546546
* `CoinsTip()`) and is fully populated. Fully populated means that if the
547547
* current active chain is missing transactions that were present in a
548548
* previously active chain, all the missing transactions will have been

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ bool TestLockPointValidity(CChain& active_chain, const LockPoints* lp)
219219
// If there are relative lock times then the maxInputBlock will be set
220220
// If there are no relative lock times, the LockPoints don't depend on the chain
221221
if (lp->maxInputBlock) {
222-
// Check whether ::ChainActive() is an extension of the block at which the LockPoints
222+
// Check whether active_chain is an extension of the block at which the LockPoints
223223
// calculation was valid. If not LockPoints are no longer valid
224224
if (!active_chain.Contains(lp->maxInputBlock)) {
225225
return false;

src/validation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static const char* const DEFAULT_BLOCKFILTERINDEX = "0";
7575
static const bool DEFAULT_PERSIST_MEMPOOL = true;
7676
/** Default for -stopatheight */
7777
static const int DEFAULT_STOPATHEIGHT = 0;
78-
/** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ::ChainActive().Tip() will not be pruned. */
78+
/** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ActiveChain().Tip() will not be pruned. */
7979
static const unsigned int MIN_BLOCKS_TO_KEEP = 288;
8080
static const signed int DEFAULT_CHECKBLOCKS = 6;
8181
static const unsigned int DEFAULT_CHECKLEVEL = 3;

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ void CWallet::updatedBlockTip()
12941294
void CWallet::BlockUntilSyncedToCurrentChain() const {
12951295
AssertLockNotHeld(cs_wallet);
12961296
// Skip the queue-draining stuff if we know we're caught up with
1297-
// ::ChainActive().Tip(), otherwise put a callback in the validation interface queue and wait
1297+
// chain().Tip(), otherwise put a callback in the validation interface queue and wait
12981298
// for the queue to drain enough to execute it (indicating we are caught up
12991299
// at least with the time we entered this function).
13001300
uint256 last_block_hash = WITH_LOCK(cs_wallet, return m_last_block_processed);

0 commit comments

Comments
 (0)