While making my de-globalize ChainstateManager changes, I noticed something that I wasn't sure what to make of: both the global instance of ChainstateManager g_chainman and the BlockManager member of g_chainman are protected by ::cs_main.
This means that changes like the following where I'm simply passing a BlockManager to a function have to add an awkward WITH_LOCK in order to appease thread safety analysis.
Examples:
However, I'm not entirely sure if these ::cs_main protections should be required for referencing these objects themselves, especially since ChainstateManager and BlockManagers's member variables/functions are already well annotated w/re locks.
Any insights would be useful :-)