HomePhabricator

refactoring: introduce unused ChainActive()

Description

refactoring: introduce unused ChainActive()

Summary:
in preparation for the following scripted-diff commit.

Partial Backport of Bitcoin Core PR15948 (commit a3a609079c):
https://github.com/bitcoin/bitcoin/pull/15948/commits/a3a609079c76dd2bbc72127488bf466cc61d8940

Depends on D5055

PR Summary:

This is part of the assumeutxo project:

Parent PR: #15606
Issue: #15605
Specification: https://github.com/jamesob/assumeutxo-docs/tree/2019-04-proposal/proposal

This change refactors the chainActive reference into a ::ChainActive() call. It also distinguishes CChainState's CChain data member as m_chain instead of the current chainActive, which makes it easily confused with the global data.

The active chain must be obtained via function because its reference will be swapped at some point during runtime after loading a UTXO snapshot.

This change, though lengthy, should be pretty easy to review since most of it is contained within a scripted-diff. Once merged, the parent PR should be easier to review.

Test Plan:

ninja check

Reviewers: #bitcoin_abc, deadalnix, O1 Bitcoin ABC

Reviewed By: #bitcoin_abc, deadalnix, O1 Bitcoin ABC

Differential Revision: https://reviews.bitcoinabc.org/D5056

Details

Provenance
James O'Beirne <james.obeirne@gmail.com>Authored on Feb 25 2020, 23:20
nakihitoCommitted on Mar 2 2020, 19:38
jasonbcoxPushed on Mar 2 2020, 19:52
Reviewer
Restricted Project
Differential Revision
D5056: refactoring: introduce unused ChainActive()
Parents
rSTAGING92a5a729ff76: [CMAKE] Fix the check-bitcoin-* targets when running with Xcode
Branches
Unknown
Tags
Unknown