Page MenuHomePhabricator

refactoring: introduce unused ChainActive()
ClosedPublic

Authored by nakihito on Jan 23 2020, 18:38.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Restricted Owners Package(Owns No Changed Paths)
Commits
rABC8b0ad8e95656: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

fpelliccioni created this revision.Jan 23 2020, 18:38
Herald added a reviewer: Restricted Project. · View Herald TranscriptJan 23 2020, 18:38
fpelliccioni edited the summary of this revision. (Show Details)Jan 23 2020, 18:40
fpelliccioni edited the test plan for this revision. (Show Details)
fpelliccioni added a reviewer: nakihito.
nakihito accepted this revision.Jan 23 2020, 19:02
This revision is now accepted and ready to land.Jan 23 2020, 19:02
nakihito commandeered this revision.Feb 28 2020, 22:06
nakihito edited reviewers, added: fpelliccioni; removed: nakihito.
This revision now requires review to proceed.Feb 28 2020, 22:06
nakihito updated this revision to Diff 16635.Feb 28 2020, 22:11
nakihito edited the summary of this revision. (Show Details)

Rebased.

Owners added a reviewer: Restricted Owners Package.Feb 28 2020, 22:11
deadalnix requested changes to this revision.EditedFeb 28 2020, 23:58

Partial Backport of Bitcoin Core PR15948 (commit a3a609079c):

Make your stuff greppable.

This revision now requires changes to proceed.Feb 28 2020, 23:58
nakihito requested review of this revision.Feb 28 2020, 23:59
nakihito edited the summary of this revision. (Show Details)

Fixed summary.

deadalnix accepted this revision.Feb 29 2020, 00:12
This revision is now accepted and ready to land.Feb 29 2020, 00:12
This revision was automatically updated to reflect the committed changes.