This PR is a follow up PR to #21244. The PR attempts to move us an inch towards the goal by removing GetDataDir(net_specific) and replacing it by gArgs.GetDataDir(net_specific) calls.
The approach of this PR attempts to be similar to the one chosen in “De-globalize ChainstateManager” (#20158). The goal is to pass ArgsManager to functions (or ideally to have ArgsManager as a member of a class where needed; inspiration from here: #21789) instead of having it as a global variable (i.e. gArgs).
Notes:
- First commit makes m_cached_blocks_pathmutableas was suggested here but not fully applied in #21244. (m_cached_datadir_pathandm_cached_network_datadir_pathwere marked asmutablein #21244) This commit can be in a separate PR too.
- Other commits deal with removing of GetDataDir(net_specific)function.
- I think that the proposed changes show nicely where there is reliance on gArgswhich is IMO a good thing.
If you know about a better approach how to do this, please share it here.