Skip to content

Commit 83003ff

Browse files
committed
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.
1 parent 8edd0d3 commit 83003ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ class PeerManagerImpl final : public PeerManager
687687

688688

689689
// All of the following cache a recent block, and are protected by m_most_recent_block_mutex
690-
RecursiveMutex m_most_recent_block_mutex;
690+
Mutex m_most_recent_block_mutex;
691691
std::shared_ptr<const CBlock> m_most_recent_block GUARDED_BY(m_most_recent_block_mutex);
692692
std::shared_ptr<const CBlockHeaderAndShortTxIDs> m_most_recent_compact_block GUARDED_BY(m_most_recent_block_mutex);
693693
uint256 m_most_recent_block_hash GUARDED_BY(m_most_recent_block_mutex);

0 commit comments

Comments
 (0)