diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-05-02 01:43:48 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-05-16 15:26:39 +0200 |
commit | 83003ffe049a432f6fa4127e054f073127e70b90 (patch) | |
tree | ba84c1a1ee0235781651511baa47bda2cac529d2 /src | |
parent | 8edd0d31ac683378135a9839e5d4172b82f8f5b8 (diff) | |
download | bitcoin-83003ffe049a432f6fa4127e054f073127e70b90.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/net_processing.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 8f875e6d27..166a3bebe3 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -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); |