@@ -529,7 +529,9 @@ class CChainState
529529
530530 // ! @returns whether or not the CoinsViews object has been fully initialized and we can
531531 // ! safely flush this object to disk.
532- bool CanFlushToDisk () const EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
532+ bool CanFlushToDisk () const EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
533+ {
534+ AssertLockHeld (::cs_main);
533535 return m_coins_views && m_coins_views->m_cacheview ;
534536 }
535537
@@ -557,15 +559,17 @@ class CChainState
557559 std::set<CBlockIndex*, node::CBlockIndexWorkComparator> setBlockIndexCandidates;
558560
559561 // ! @returns A reference to the in-memory cache of the UTXO set.
560- CCoinsViewCache& CoinsTip () EXCLUSIVE_LOCKS_REQUIRED(cs_main)
562+ CCoinsViewCache& CoinsTip () EXCLUSIVE_LOCKS_REQUIRED(:: cs_main)
561563 {
564+ AssertLockHeld (::cs_main);
562565 assert (m_coins_views->m_cacheview );
563566 return *m_coins_views->m_cacheview .get ();
564567 }
565568
566569 // ! @returns A reference to the on-disk UTXO set database.
567- CCoinsViewDB& CoinsDB () EXCLUSIVE_LOCKS_REQUIRED(cs_main)
570+ CCoinsViewDB& CoinsDB () EXCLUSIVE_LOCKS_REQUIRED(:: cs_main)
568571 {
572+ AssertLockHeld (::cs_main);
569573 return m_coins_views->m_dbview ;
570574 }
571575
@@ -577,8 +581,9 @@ class CChainState
577581
578582 // ! @returns A reference to a wrapped view of the in-memory UTXO set that
579583 // ! handles disk read errors gracefully.
580- CCoinsViewErrorCatcher& CoinsErrorCatcher () EXCLUSIVE_LOCKS_REQUIRED(cs_main)
584+ CCoinsViewErrorCatcher& CoinsErrorCatcher () EXCLUSIVE_LOCKS_REQUIRED(:: cs_main)
581585 {
586+ AssertLockHeld (::cs_main);
582587 return m_coins_views->m_catcherview ;
583588 }
584589
@@ -924,6 +929,7 @@ class ChainstateManager
924929
925930 node::BlockMap& BlockIndex () EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
926931 {
932+ AssertLockHeld (::cs_main);
927933 return m_blockman.m_block_index ;
928934 }
929935
0 commit comments