HomePhabricator

validation: Remove global ::ActivateBestChain

Description

validation: Remove global ::ActivateBestChain

Summary:
Instead use CChainState::ActivateBestChain, which is what the global one calls anyway.

This is a backport of core#20749 [12/17]
https://github.com/bitcoin/bitcoin/pull/20749/commits/5f8cd7b3a527999512161956db4d718688cb956f

Depends on D11183

Note that the change in default argument from a null CBlock shared pointer to a nullptr does not change behavior, as both cases lead to the same code path of ActivateBestChainStep() being called with a null Cblock pointer.

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Carl Dong <contact@carldong.me>Authored on Mar 16 2022, 10:51
PiRKCommitted on Mar 16 2022, 14:24
PiRKPushed on Mar 16 2022, 14:24
Reviewer
Restricted Project
Differential Revision
D11184: validation: Remove global ::ActivateBestChain
Parents
rABCffd0454d645e: validation: Pass in chainstate to ::NotifyHeaderTip
Branches
Unknown
Tags
Unknown