refactor: replace RecursiveMutex m_most_recent_block_mutex with Mutex

In each of the critical sections, only the the guarded variables are
accessed, without any chance that within one section another one is
called.  Hence, we can use an ordinary Mutex instead of RecursiveMutex.
This commit is contained in:
Sebastian Falbesoner 2022-05-02 01:43:48 +02:00
parent 8edd0d31ac
commit 83003ffe04

View file

@ -687,7 +687,7 @@ private:
// All of the following cache a recent block, and are protected by m_most_recent_block_mutex
RecursiveMutex m_most_recent_block_mutex;
Mutex m_most_recent_block_mutex;
std::shared_ptr<const CBlock> m_most_recent_block GUARDED_BY(m_most_recent_block_mutex);
std::shared_ptr<const CBlockHeaderAndShortTxIDs> m_most_recent_compact_block GUARDED_BY(m_most_recent_block_mutex);
uint256 m_most_recent_block_hash GUARDED_BY(m_most_recent_block_mutex);