HomePhabricator

validation: Prune UnloadBlockIndex and callees

Description

validation: Prune UnloadBlockIndex and callees

Summary:
In previous commits in this patchset, we've made sure that every
Unload/UnloadBlockIndex member function resets its own members, and does
not reach out to globals.

This means that their corresponding classes' default destructors can now
replace them, and do an even more thorough job without the need to be
updated for every new member variable.

Therefore, we can remove them, and also remove UnloadBlockIndex since
that's not used anymore.

Unfortunately, chainstatemanager_loadblockindex relies on
CChainState::UnloadBlockIndex, so that needs to stay for now.

This concludes backport of core#22564
https://github.com/bitcoin/bitcoin/pull/22564/commits/7ab07e033237d6ea179a6a2c76575ed6bd01a670

Depends on D13091

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, sdulfari

Reviewed By: #bitcoin_abc, sdulfari

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

Details

Provenance
Carl Dong <contact@carldong.me>Authored on Jan 12 2021, 18:38
PiRKCommitted on Feb 3 2023, 07:29
PiRKPushed on Feb 3 2023, 07:30
Reviewer
Restricted Project
Differential Revision
D13092: validation: Prune UnloadBlockIndex and callees
Parents
rABC1081aa8a6078: make pindexBestForkTip and pindexBestForkBase private CChainState members
Branches
Unknown
Tags
Unknown