mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-08 17:30:36 +02:00
validation: Guard all chainstates with cs_main
Since these chainstates are: 1. Also vulnerable to the race condition described in the previous commit 2. Documented as having similar semantics as m_active_chainstate we should also protect them with ::cs_main.
This commit is contained in:
@ -802,7 +802,7 @@ private:
|
||||
//! This is especially important when, e.g., calling ActivateBestChain()
|
||||
//! on all chainstates because we are not able to hold ::cs_main going into
|
||||
//! that call.
|
||||
std::unique_ptr<CChainState> m_ibd_chainstate;
|
||||
std::unique_ptr<CChainState> m_ibd_chainstate GUARDED_BY(::cs_main);
|
||||
|
||||
//! A chainstate initialized on the basis of a UTXO snapshot. If this is
|
||||
//! non-null, it is always our active chainstate.
|
||||
@ -815,7 +815,7 @@ private:
|
||||
//! This is especially important when, e.g., calling ActivateBestChain()
|
||||
//! on all chainstates because we are not able to hold ::cs_main going into
|
||||
//! that call.
|
||||
std::unique_ptr<CChainState> m_snapshot_chainstate;
|
||||
std::unique_ptr<CChainState> m_snapshot_chainstate GUARDED_BY(::cs_main);
|
||||
|
||||
//! Points to either the ibd or snapshot chainstate; indicates our
|
||||
//! most-work chain.
|
||||
|
Reference in New Issue
Block a user