There are a few potential improvements mentioned by various reviewers of the chainman-deglobalizing work that are deserving of a tracking ticket, but are perhaps either not crucial to the main thrust of the work or the flaws already existed before the work. Let’s discuss and collate them here so that we don’t lose track of them!
m_chainmethods should perhaps require holdingcs_mainEnsure*()in src/rpc should be called at the top of functions to fail as early as possible- IncrementExtraNonce does not need
cs_main, and the locking scope can be limited CoinsDB.Cursor()passes ownership to caller and should return astd::unique_ptr- Call to
GetNetworkHashPSingetnetworkhashpscontains many operators, which may increase risk of precedence bugs - Avoid repeated calls to
ActiveChain()where appropriate - Review whether or not
m_blockmanmember ofChainstateManagerneedscs_mainto be accessed- Various
- Review whether or not to support running bitcoin without a chainman
- Investigate how indexing interacts with
CChainState
Please feel free to comment here for extra ones I’ve missed!