Skip to content

Conversation

meshcollider
Copy link
Contributor

After #21866 there are a few outdated comments referring to ::ChainActive(), which should instead refer to ChainstateManager::ActiveChain().

@jamesob
Copy link
Contributor

jamesob commented Oct 19, 2021

ACK a0efe52

Thanks @meshcollider!

@fanquake fanquake merged commit 0ccf9b2 into bitcoin:master Oct 20, 2021
@meshcollider meshcollider deleted the 202110_outdated_chainstate_comments branch October 20, 2021 05:30
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 20, 2021
…ctive()

a0efe52 Fix outdated comments referring to ::ChainActive() (Samuel Dobson)

Pull request description:

  After bitcoin#21866 there are a few outdated comments referring to `::ChainActive()`, which should instead refer to `ChainstateManager::ActiveChain()`.

ACKs for top commit:
  jamesob:
    ACK bitcoin@a0efe52

Tree-SHA512: 80da19c105ed29ac247e6df4c8e916c3bf3f37230b63f07302114eef9c115add673e9649f0bbe237295be0c6da7b1030b5b93e14daf6768f17ce5de7cf2c9ff2
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jul 15, 2022
…lizeBlock

Summary:
This removes the last occurences of `::Chain(State)Active` in the code after D11704, D11742 and D11744 are landed. There are some remaining occurences in comments, which are removed in a later backport ([[bitcoin/bitcoin#23258 | core#23258]])

I checked in the codebase that these methods are only called on the active chainstate. It does not make much sense to finalize blocks in a chain base on the state of some other chain anyway.

Test Plan:
Before running the tests, add the following line in both modified methods:

`assert(std::addressof(m_chain) == std::addressof(::ChainActive()));`

`ninja all check-all`

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D11748
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jul 15, 2022
Summary:
Remove also a comment about g_chainstate.
The additional `::ChainActive` comment removed in  validation.cpp  was missed in  a backport in D1972.

This is a backport of [[bitcoin/bitcoin#23258 | core#23258]]

Test Plan:
```
grep -r "::Chain\w*A" ../src/
grep -r "g_chainman" ../src/
```

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11755
@bitcoin bitcoin locked and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants