Page MenuHomePhabricator

validation: Move FindForkInGlobalIndex to BlockManager
ClosedPublic

Authored by PiRK on Mar 15 2022, 15:37.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC391e49e3db12: validation: Move FindForkInGlobalIndex to BlockManager
Summary

[META] This commit should be followed up by removing the comments and assertions meant only to show that the change is correct.

FindForkInGlobalIndex only acts on BlockManager.

Note to reviewers: Since` FindForkInGlobalIndex` is always called with
::ChainActive() as its first parameter, it is possible to move
FindForkInGlobalIndex to CChainState and remove this const CChain&
parameter to instead use m_chain. However, it seems like the original
intention was for FindForkInGlobalIndex to work with _any_ chain, not
just the current active chain. Let me know if this should be changed.

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

Depends on D11173

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable