0This avoids a potential race-condition where a thread is reading the
1ChainstateManager::m_active_chainstate pointer while another one is
2writing to it. There is no portable guarantee that reading/writing the
3pointer is thread-safe.
4
5This is also done in way that mimics ::ChainstateActive(), so the
6transition from that function to this method is easy.
7
8More discussion:
91. [#20749 (review)](/bitcoin-bitcoin/20749/#discussion_r559544027)
102. [#19806 (review)](/bitcoin-bitcoin/19806/#discussion_r561023961)
113. [#19806 (comment)](/bitcoin-bitcoin/19806/#issuecomment-768946522)
124. [#19806 (comment)](/bitcoin-bitcoin/19806/#issuecomment-768955695)
Basically this PR removes the loaded-but-unfired footgun, which:
- Is multiplied (but still unshot) in the chainman deglobalization PRs (#20158)
- Is shot in the test framework in the au.activate PR (#19806)