Merge bitcoin/bitcoin#23258: doc: Fix outdated comments referring to ::ChainActive()

BACKPORT NOTE:
changes for TestLockPointValidity in src/validation.cpp are applied to the same function but in src/txmempool.cpp

a0efe529e4fd053b890450413b9ca5e1bcd8f2c2 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 a0efe529e4

Tree-SHA512: 80da19c105ed29ac247e6df4c8e916c3bf3f37230b63f07302114eef9c115add673e9649f0bbe237295be0c6da7b1030b5b93e14daf6768f17ce5de7cf2c9ff2
This commit is contained in:
fanquake 2021-10-20 13:13:44 +08:00 committed by Konstantin Akimov
parent dcbf671551
commit a3e6378108
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524
5 changed files with 5 additions and 5 deletions

View File

@ -331,7 +331,7 @@ bool BaseIndex::BlockUntilSyncedToCurrentChain() const
{ {
// Skip the queue-draining stuff if we know we're caught up with // Skip the queue-draining stuff if we know we're caught up with
// ::ChainActive().Tip(). // m_chain.Tip().
LOCK(cs_main); LOCK(cs_main);
const CBlockIndex* chain_tip = m_chainstate->m_chain.Tip(); const CBlockIndex* chain_tip = m_chainstate->m_chain.Tip();
const CBlockIndex* best_block_index = m_best_block_index.load(); const CBlockIndex* best_block_index = m_best_block_index.load();

View File

@ -554,7 +554,7 @@ void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, boo
if (txHeight != nBestSeenHeight) { if (txHeight != nBestSeenHeight) {
// Ignore side chains and re-orgs; assuming they are random they don't // Ignore side chains and re-orgs; assuming they are random they don't
// affect the estimate. We'll potentially double count transactions in 1-block reorgs. // affect the estimate. We'll potentially double count transactions in 1-block reorgs.
// Ignore txs if BlockPolicyEstimator is not in sync with ::ChainActive().Tip(). // Ignore txs if BlockPolicyEstimator is not in sync with ActiveChain().Tip().
// It will be synced next time a block is processed. // It will be synced next time a block is processed.
return; return;
} }

View File

@ -498,7 +498,7 @@ public:
* By design, it is guaranteed that: * By design, it is guaranteed that:
* *
* 1. Locking both `cs_main` and `mempool.cs` will give a view of mempool * 1. Locking both `cs_main` and `mempool.cs` will give a view of mempool
* that is consistent with current chain tip (`::ChainActive()` and * that is consistent with current chain tip (`ActiveChain()` and
* `CoinsTip()`) and is fully populated. Fully populated means that if the * `CoinsTip()`) and is fully populated. Fully populated means that if the
* current active chain is missing transactions that were present in a * current active chain is missing transactions that were present in a
* previously active chain, all the missing transactions will have been * previously active chain, all the missing transactions will have been

View File

@ -101,7 +101,7 @@ static const bool DEFAULT_SYNC_MEMPOOL = true;
/** Default for -stopatheight */ /** Default for -stopatheight */
static const int DEFAULT_STOPATHEIGHT = 0; static const int DEFAULT_STOPATHEIGHT = 0;
/** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ::ChainActive().Tip() will not be pruned. */ /** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ActiveChain().Tip() will not be pruned. */
static const unsigned int MIN_BLOCKS_TO_KEEP = 288; static const unsigned int MIN_BLOCKS_TO_KEEP = 288;
static const signed int DEFAULT_CHECKBLOCKS = 6; static const signed int DEFAULT_CHECKBLOCKS = 6;
static const unsigned int DEFAULT_CHECKLEVEL = 3; static const unsigned int DEFAULT_CHECKLEVEL = 3;

View File

@ -1366,7 +1366,7 @@ void CWallet::updatedBlockTip()
void CWallet::BlockUntilSyncedToCurrentChain() const { void CWallet::BlockUntilSyncedToCurrentChain() const {
AssertLockNotHeld(cs_wallet); AssertLockNotHeld(cs_wallet);
// Skip the queue-draining stuff if we know we're caught up with // Skip the queue-draining stuff if we know we're caught up with
// chainActive.Tip(), otherwise put a callback in the validation interface queue and wait // chain().Tip(), otherwise put a callback in the validation interface queue and wait
// for the queue to drain enough to execute it (indicating we are caught up // for the queue to drain enough to execute it (indicating we are caught up
// at least with the time we entered this function). // at least with the time we entered this function).
uint256 last_block_hash = WITH_LOCK(cs_wallet, return m_last_block_processed); uint256 last_block_hash = WITH_LOCK(cs_wallet, return m_last_block_processed);