Overall PR: #20158 (tree-wide: De-globalize ChainstateManager)
Note to reviewers:
- This bundle may apparently introduce usage of g_chainmanor::Chain(state|)Active()globals, but these are resolved later on in the overall PR. Commits of overall PR
- There may be seemingly obvious local references to ChainstateManageror other validation objects which are not being used in callers of the current function in question, this is done intentionally to keep each commit centered around one function/method to ease review and to make the overall change systematic. We don’t assume anything about our callers. Rest assured that once we are considering that particular caller in later commits, we will use the obvious local references. Commits of overall PR
- When changing a function/method that has many callers (e.g. LookupBlockIndexwith 55 callers), it is sometimes easier (and less error-prone) to use a scripted-diff. When doing so, there will be 3 commits in sequence so that every commit compiles like so:- Add new_function, makeold_functiona wrapper ofnew_function, divert all calls toold_functiontonew_functionin the local module only
- Scripted-diff to divert all calls to old_functiontonew_functionin the rest of the codebase
- Remove old_function
 
- Add