diff options
author | Ryan Ofsky <ryan@ofsky.org> | 2022-01-10 15:26:13 -0500 |
---|---|---|
committer | Ryan Ofsky <ryan@ofsky.org> | 2022-01-11 05:11:00 -0500 |
commit | ce95fb36af7db6582216adc64f2a66aaa06b55b3 (patch) | |
tree | e6b6d193c9c36014c7233e9963b2b16740684214 /src/validation.h | |
parent | c561f2f06ed25f08f7776ac41aeb2999ebe79550 (diff) |
Remove cs_main lock annotation from ChainstateManager.m_blockman
BlockManager is a large data structure, and cs_main is not required to
take its address or access every part of it. Individual BlockManager
fields and methods which do require cs_main like m_block_index and
LookupBlockIndex are already annotated separately, and these other
annotations describe locking requirements more accurately and do a
better job enforcing thread safety.
Since cs_main is not needed to access the address of the m_block object,
this commit drops cs_main LOCK calls which were added pointlessly to
satisfy this annotation in the past.
Co-authored-by: Carl Dong <contact@carldong.me>
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/validation.h b/src/validation.h index fdc4e73b0a..edbd68f783 100644 --- a/src/validation.h +++ b/src/validation.h @@ -828,7 +828,7 @@ public: std::thread m_load_block; //! A single BlockManager instance is shared across each constructed //! chainstate to avoid duplicating block metadata. - node::BlockManager m_blockman GUARDED_BY(::cs_main); + node::BlockManager m_blockman; /** * In order to efficiently track invalidity of headers, we keep the set of |