aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-08-28 19:59:41 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-11-24 19:34:26 +0100
commit7d52ff5c389643cde613d86fee33d7087f47b8b4 (patch)
tree2acf44d95f919d267f7b1bba38648c4d60a60630 /src
parentd51d2a3bb5b0011efa1b4f1e2c9512a16ce9b347 (diff)
downloadbitcoin-7d52ff5c389643cde613d86fee33d7087f47b8b4.tar.xz
refactor: replace RecursiveMutex m_addr_fetches_mutex with Mutex
The RecursiveMutex m_addr_fetches_mutex is used at three places: - CConnman::AddAddrFetch() - CConnman::ProcessAddrFetch() - CConnman::ThreadOpenConnections() In each of the critical sections, only the the m_addr_fetches is accessed (and in the last case, also vAddedNodes), 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.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.h b/src/net.h
index a10b055a97..93d36a6e3d 100644
--- a/src/net.h
+++ b/src/net.h
@@ -1098,7 +1098,7 @@ private:
bool fAddressesInitialized{false};
AddrMan& addrman;
std::deque<std::string> m_addr_fetches GUARDED_BY(m_addr_fetches_mutex);
- RecursiveMutex m_addr_fetches_mutex;
+ Mutex m_addr_fetches_mutex;
std::vector<std::string> m_added_nodes GUARDED_BY(m_added_nodes_mutex);
mutable RecursiveMutex m_added_nodes_mutex;
std::vector<CNode*> m_nodes GUARDED_BY(m_nodes_mutex);