@@ -1263,8 +1263,8 @@ friend class CNode;
1263
1263
EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex, !m_added_nodes_mutex, !m_addr_fetches_mutex, !mutexMsgProc);
1264
1264
1265
1265
void StopThreads ();
1266
- void StopNodes ();
1267
- void Stop ()
1266
+ void StopNodes () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1267
+ void Stop () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1268
1268
{
1269
1269
StopThreads ();
1270
1270
StopNodes ();
@@ -1292,10 +1292,10 @@ friend class CNode;
1292
1292
const char * strDest, ConnectionType conn_type, bool use_v2transport,
1293
1293
MasternodeConn masternode_connection = MasternodeConn::IsNotConnection,
1294
1294
MasternodeProbeConn masternode_probe_connection = MasternodeProbeConn::IsNotConnection)
1295
- EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex, !mutexMsgProc);
1295
+ EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex, !mutexMsgProc, !m_nodes_mutex );
1296
1296
void OpenMasternodeConnection (const CAddress& addrConnect, bool use_v2transport, MasternodeProbeConn probe = MasternodeProbeConn::IsConnection)
1297
- EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex, !mutexMsgProc);
1298
- bool CheckIncomingNonce (uint64_t nonce);
1297
+ EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex, !mutexMsgProc, !m_nodes_mutex );
1298
+ bool CheckIncomingNonce (uint64_t nonce) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1299
1299
1300
1300
// alias for thread safety annotations only, not defined
1301
1301
RecursiveMutex& GetNodesMutex () const LOCK_RETURNED(m_nodes_mutex);
@@ -1314,37 +1314,37 @@ friend class CNode;
1314
1314
1315
1315
constexpr static const CAllNodes AllNodes{};
1316
1316
1317
- bool ForNode (NodeId id, std::function<bool (const CNode* pnode)> cond, std::function<bool(CNode* pnode)> func);
1318
- bool ForNode (const CService& addr, std::function<bool (const CNode* pnode)> cond, std::function<bool(CNode* pnode)> func);
1317
+ bool ForNode (NodeId id, std::function<bool (const CNode* pnode)> cond, std::function<bool(CNode* pnode)> func) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1318
+ bool ForNode (const CService& addr, std::function<bool (const CNode* pnode)> cond, std::function<bool(CNode* pnode)> func) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1319
1319
1320
1320
template <typename Callable>
1321
- bool ForNode (const CService& addr, Callable&& func)
1321
+ bool ForNode (const CService& addr, Callable&& func) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1322
1322
{
1323
1323
return ForNode (addr, FullyConnectedOnly, func);
1324
1324
}
1325
1325
1326
1326
template <typename Callable>
1327
- bool ForNode (NodeId id, Callable&& func)
1327
+ bool ForNode (NodeId id, Callable&& func) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1328
1328
{
1329
1329
return ForNode (id, FullyConnectedOnly, func);
1330
1330
}
1331
1331
1332
1332
using NodeFn = std::function<void (CNode*)>;
1333
1333
1334
- bool IsConnected (const CService& addr, std::function<bool (const CNode* pnode)> cond)
1334
+ bool IsConnected (const CService& addr, std::function<bool (const CNode* pnode)> cond) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1335
1335
{
1336
1336
return ForNode (addr, cond, [](CNode* pnode){
1337
1337
return true ;
1338
1338
});
1339
1339
}
1340
1340
1341
- bool IsMasternodeOrDisconnectRequested (const CService& addr);
1341
+ bool IsMasternodeOrDisconnectRequested (const CService& addr) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1342
1342
1343
1343
void PushMessage (CNode* pnode, CSerializedNetMsg&& msg)
1344
1344
EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc, !m_total_bytes_sent_mutex);
1345
1345
1346
1346
template <typename Condition, typename Callable>
1347
- bool ForEachNodeContinueIf (const Condition& cond, Callable&& func)
1347
+ bool ForEachNodeContinueIf (const Condition& cond, Callable&& func) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1348
1348
{
1349
1349
LOCK (m_nodes_mutex);
1350
1350
for (auto && node : m_nodes)
@@ -1361,7 +1361,7 @@ friend class CNode;
1361
1361
}
1362
1362
1363
1363
template <typename Condition, typename Callable>
1364
- bool ForEachNodeContinueIf (const Condition& cond, Callable&& func) const
1364
+ bool ForEachNodeContinueIf (const Condition& cond, Callable&& func) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1365
1365
{
1366
1366
LOCK (m_nodes_mutex);
1367
1367
for (const auto & node : m_nodes)
@@ -1378,7 +1378,7 @@ friend class CNode;
1378
1378
}
1379
1379
1380
1380
template <typename Condition, typename Callable>
1381
- void ForEachNode (const Condition& cond, Callable&& func)
1381
+ void ForEachNode (const Condition& cond, Callable&& func) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1382
1382
{
1383
1383
LOCK (m_nodes_mutex);
1384
1384
for (auto && node : m_nodes) {
@@ -1387,13 +1387,13 @@ friend class CNode;
1387
1387
}
1388
1388
};
1389
1389
1390
- void ForEachNode (const NodeFn& fn)
1390
+ void ForEachNode (const NodeFn& fn) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1391
1391
{
1392
1392
ForEachNode (FullyConnectedOnly, fn);
1393
1393
}
1394
1394
1395
1395
template <typename Condition, typename Callable>
1396
- void ForEachNode (const Condition& cond, Callable&& func) const
1396
+ void ForEachNode (const Condition& cond, Callable&& func) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1397
1397
{
1398
1398
LOCK (m_nodes_mutex);
1399
1399
for (auto && node : m_nodes) {
@@ -1402,13 +1402,13 @@ friend class CNode;
1402
1402
}
1403
1403
};
1404
1404
1405
- void ForEachNode (const NodeFn& fn) const
1405
+ void ForEachNode (const NodeFn& fn) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1406
1406
{
1407
1407
ForEachNode (FullyConnectedOnly, fn);
1408
1408
}
1409
1409
1410
1410
template <typename Condition, typename Callable, typename CallableAfter>
1411
- void ForEachNodeThen (const Condition& cond, Callable&& pre, CallableAfter&& post)
1411
+ void ForEachNodeThen (const Condition& cond, Callable&& pre, CallableAfter&& post) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1412
1412
{
1413
1413
LOCK (m_nodes_mutex);
1414
1414
for (auto && node : m_nodes) {
@@ -1419,13 +1419,13 @@ friend class CNode;
1419
1419
};
1420
1420
1421
1421
template <typename Callable, typename CallableAfter>
1422
- void ForEachNodeThen (Callable&& pre, CallableAfter&& post)
1422
+ void ForEachNodeThen (Callable&& pre, CallableAfter&& post) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1423
1423
{
1424
1424
ForEachNodeThen (FullyConnectedOnly, pre, post);
1425
1425
}
1426
1426
1427
1427
template <typename Condition, typename Callable, typename CallableAfter>
1428
- void ForEachNodeThen (const Condition& cond, Callable&& pre, CallableAfter&& post) const
1428
+ void ForEachNodeThen (const Condition& cond, Callable&& pre, CallableAfter&& post) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
1429
1429
{
1430
1430
LOCK (m_nodes_mutex);
1431
1431
for (auto && node : m_nodes) {
@@ -1475,14 +1475,14 @@ friend class CNode;
1475
1475
// return a value less than (num_outbound_connections - num_outbound_slots)
1476
1476
// in cases where some outbound connections are not yet fully connected, or
1477
1477
// not yet fully disconnected.
1478
- int GetExtraFullOutboundCount () const ;
1478
+ int GetExtraFullOutboundCount () const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1479
1479
// Count the number of block-relay-only peers we have over our limit.
1480
- int GetExtraBlockRelayCount () const ;
1480
+ int GetExtraBlockRelayCount () const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1481
1481
1482
1482
bool AddNode (const AddedNodeParams& add) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex);
1483
1483
bool RemoveAddedNode (const std::string& node) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex);
1484
1484
bool AddedNodesContain (const CAddress& addr) const EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex);
1485
- std::vector<AddedNodeInfo> GetAddedNodeInfo (bool include_connected) const EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex);
1485
+ std::vector<AddedNodeInfo> GetAddedNodeInfo (bool include_connected) const EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex, !m_nodes_mutex );
1486
1486
1487
1487
/* *
1488
1488
* Attempts to open a connection. Currently only used from tests.
@@ -1498,28 +1498,28 @@ friend class CNode;
1498
1498
* - Max connection capacity for type is filled
1499
1499
*/
1500
1500
bool AddConnection (const std::string& address, ConnectionType conn_type, bool use_v2transport)
1501
- EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex, !mutexMsgProc);
1501
+ EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex, !mutexMsgProc, !m_nodes_mutex );
1502
1502
1503
1503
bool AddPendingMasternode (const uint256& proTxHash);
1504
1504
void SetMasternodeQuorumNodes (Consensus::LLMQType llmqType, const uint256& quorumHash, const std::set<uint256>& proTxHashes);
1505
- void SetMasternodeQuorumRelayMembers (Consensus::LLMQType llmqType, const uint256& quorumHash, const std::set<uint256>& proTxHashes);
1505
+ void SetMasternodeQuorumRelayMembers (Consensus::LLMQType llmqType, const uint256& quorumHash, const std::set<uint256>& proTxHashes) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1506
1506
bool HasMasternodeQuorumNodes (Consensus::LLMQType llmqType, const uint256& quorumHash) const ;
1507
1507
std::set<uint256> GetMasternodeQuorums (Consensus::LLMQType llmqType) const ;
1508
1508
// also returns QWATCH nodes
1509
- std::set<NodeId> GetMasternodeQuorumNodes (Consensus::LLMQType llmqType, const uint256& quorumHash) const ;
1509
+ std::set<NodeId> GetMasternodeQuorumNodes (Consensus::LLMQType llmqType, const uint256& quorumHash) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1510
1510
void RemoveMasternodeQuorumNodes (Consensus::LLMQType llmqType, const uint256& quorumHash);
1511
1511
bool IsMasternodeQuorumNode (const CNode* pnode, const CDeterministicMNList& tip_mn_list) const ;
1512
1512
bool IsMasternodeQuorumRelayMember (const uint256& protxHash);
1513
1513
void AddPendingProbeConnections (const std::set<uint256>& proTxHashes);
1514
1514
1515
- size_t GetNodeCount (ConnectionDirection) const ;
1515
+ size_t GetNodeCount (ConnectionDirection) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1516
1516
size_t GetMaxOutboundNodeCount ();
1517
1517
size_t GetMaxOutboundOnionNodeCount ();
1518
- void GetNodeStats (std::vector<CNodeStats>& vstats) const ;
1519
- bool DisconnectNode (const std::string& node);
1520
- bool DisconnectNode (const CSubNet& subnet);
1521
- bool DisconnectNode (const CNetAddr& addr);
1522
- bool DisconnectNode (NodeId id);
1518
+ void GetNodeStats (std::vector<CNodeStats>& vstats) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1519
+ bool DisconnectNode (const std::string& node) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1520
+ bool DisconnectNode (const CSubNet& subnet) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1521
+ bool DisconnectNode (const CNetAddr& addr) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1522
+ bool DisconnectNode (NodeId id) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1523
1523
1524
1524
// ! Used to convey which local services we are offering peers during node
1525
1525
// ! connection.
@@ -1564,7 +1564,7 @@ friend class CNode;
1564
1564
{
1565
1565
public:
1566
1566
explicit NodesSnapshot (const CConnman& connman, std::function<bool (const CNode* pnode)> cond = AllNodes,
1567
- bool shuffle = false);
1567
+ bool shuffle = false) EXCLUSIVE_LOCKS_REQUIRED(!connman.m_nodes_mutex) ;
1568
1568
~NodesSnapshot ();
1569
1569
1570
1570
const std::vector<CNode*>& Nodes () const
@@ -1599,16 +1599,16 @@ friend class CNode;
1599
1599
bool InitBinds (const Options& options);
1600
1600
1601
1601
void ThreadOpenAddedConnections ()
1602
- EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex, !m_unused_i2p_sessions_mutex, !m_reconnections_mutex, !mutexMsgProc);
1602
+ EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex, !m_unused_i2p_sessions_mutex, !m_reconnections_mutex, !mutexMsgProc, !m_nodes_mutex );
1603
1603
void AddAddrFetch (const std::string& strDest) EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex);
1604
1604
void ProcessAddrFetch ()
1605
- EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex, !m_unused_i2p_sessions_mutex, !mutexMsgProc);
1605
+ EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex, !m_unused_i2p_sessions_mutex, !mutexMsgProc, !m_nodes_mutex );
1606
1606
void ThreadOpenConnections (const std::vector<std::string> connect, CDeterministicMNManager& dmnman)
1607
1607
EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex, !m_added_nodes_mutex, !m_nodes_mutex, !m_unused_i2p_sessions_mutex, !m_reconnections_mutex, !mutexMsgProc);
1608
- void ThreadMessageHandler () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
1609
- void ThreadI2PAcceptIncoming (CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
1608
+ void ThreadMessageHandler () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc, !m_nodes_mutex );
1609
+ void ThreadI2PAcceptIncoming (CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc, !m_nodes_mutex );
1610
1610
void AcceptConnection (const ListenSocket& hListenSocket, CMasternodeSync& mn_sync)
1611
- EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
1611
+ EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc, !m_nodes_mutex );
1612
1612
1613
1613
/* *
1614
1614
* Create a `CNode` object from a socket that has just been accepted and add the node to
@@ -1622,11 +1622,11 @@ friend class CNode;
1622
1622
NetPermissionFlags permission_flags,
1623
1623
const CAddress& addr_bind,
1624
1624
const CAddress& addr,
1625
- CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
1625
+ CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc, !m_nodes_mutex );
1626
1626
1627
1627
void DisconnectNodes () EXCLUSIVE_LOCKS_REQUIRED(!m_reconnections_mutex, !m_nodes_mutex);
1628
- void NotifyNumConnectionsChanged (CMasternodeSync& mn_sync);
1629
- void CalculateNumConnectionsChangedStats ();
1628
+ void NotifyNumConnectionsChanged (CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1629
+ void CalculateNumConnectionsChangedStats () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1630
1630
/* * Return true if the peer is inactive and should be disconnected. */
1631
1631
bool InactivityCheck (const CNode& node) const ;
1632
1632
@@ -1686,7 +1686,7 @@ friend class CNode;
1686
1686
/* *
1687
1687
* Check connected and listening sockets for IO readiness and process them accordingly.
1688
1688
*/
1689
- void SocketHandler (CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex, !mutexMsgProc);
1689
+ void SocketHandler (CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex, !mutexMsgProc, !m_nodes_mutex );
1690
1690
1691
1691
/* *
1692
1692
* Do the read/write for connected sockets that are ready for IO.
@@ -1697,14 +1697,14 @@ friend class CNode;
1697
1697
void SocketHandlerConnected (const std::set<SOCKET>& recv_set,
1698
1698
const std::set<SOCKET>& send_set,
1699
1699
const std::set<SOCKET>& error_set)
1700
- EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex, !mutexMsgProc);
1700
+ EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex, !mutexMsgProc, !m_nodes_mutex );
1701
1701
1702
1702
/* *
1703
1703
* Accept incoming connections, one from each read-ready listening socket.
1704
1704
* @param[in] recv_set Sockets that are ready for read.
1705
1705
*/
1706
1706
void SocketHandlerListening (const std::set<SOCKET>& recv_set, CMasternodeSync& mn_sync)
1707
- EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
1707
+ EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc, !m_nodes_mutex );
1708
1708
1709
1709
void ThreadSocketHandler (CMasternodeSync& mn_sync)
1710
1710
EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex, !mutexMsgProc, !m_nodes_mutex, !m_reconnections_mutex);
@@ -1715,19 +1715,19 @@ friend class CNode;
1715
1715
1716
1716
uint64_t CalculateKeyedNetGroup (const CAddress& ad) const ;
1717
1717
1718
- CNode* FindNode (const CNetAddr& ip, bool fExcludeDisconnecting = true );
1719
- CNode* FindNode (const CSubNet& subNet, bool fExcludeDisconnecting = true );
1720
- CNode* FindNode (const std::string& addrName, bool fExcludeDisconnecting = true );
1721
- CNode* FindNode (const CService& addr, bool fExcludeDisconnecting = true );
1718
+ CNode* FindNode (const CNetAddr& ip, bool fExcludeDisconnecting = true ) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1719
+ CNode* FindNode (const CSubNet& subNet, bool fExcludeDisconnecting = true ) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1720
+ CNode* FindNode (const std::string& addrName, bool fExcludeDisconnecting = true ) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1721
+ CNode* FindNode (const CService& addr, bool fExcludeDisconnecting = true ) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1722
1722
1723
1723
/* *
1724
1724
* Determine whether we're already connected to a given address, in order to
1725
1725
* avoid initiating duplicate connections.
1726
1726
*/
1727
- bool AlreadyConnectedToAddress (const CAddress& addr);
1727
+ bool AlreadyConnectedToAddress (const CAddress& addr) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1728
1728
1729
- bool AttemptToEvictConnection ();
1730
- CNode* ConnectNode (CAddress addrConnect, const char *pszDest, bool fCountFailure , ConnectionType conn_type, bool use_v2transport) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex);
1729
+ bool AttemptToEvictConnection () EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1730
+ CNode* ConnectNode (CAddress addrConnect, const char *pszDest, bool fCountFailure , ConnectionType conn_type, bool use_v2transport) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex, !m_nodes_mutex );
1731
1731
void AddWhitelistPermissionFlags (NetPermissionFlags& flags, const CNetAddr &addr) const ;
1732
1732
1733
1733
void DeleteNode (CNode* pnode);
@@ -1737,7 +1737,7 @@ friend class CNode;
1737
1737
/* * (Try to) send data from node's vSendMsg. Returns (bytes_sent, data_left). */
1738
1738
std::pair<size_t , bool > SocketSendData (CNode& node) const EXCLUSIVE_LOCKS_REQUIRED(node.cs_vSend);
1739
1739
1740
- size_t SocketRecvData (CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
1740
+ size_t SocketRecvData (CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc, !m_nodes_mutex );
1741
1741
1742
1742
void DumpAddresses ();
1743
1743
@@ -1754,7 +1754,7 @@ friend class CNode;
1754
1754
/* *
1755
1755
* Return vector of current BLOCK_RELAY peers.
1756
1756
*/
1757
- std::vector<CAddress> GetCurrentBlockRelayOnlyConns () const ;
1757
+ std::vector<CAddress> GetCurrentBlockRelayOnlyConns () const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1758
1758
1759
1759
/* *
1760
1760
* Search for a "preferred" network, a reachable network to which we
@@ -1766,7 +1766,7 @@ friend class CNode;
1766
1766
*
1767
1767
* @return bool Whether a preferred network was found.
1768
1768
*/
1769
- bool MaybePickPreferredNetwork (std::optional<Network>& network);
1769
+ bool MaybePickPreferredNetwork (std::optional<Network>& network) EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex) ;
1770
1770
1771
1771
// Whether the node should be passed out in ForEach* callbacks
1772
1772
static bool NodeFullyConnected (const CNode* pnode);
@@ -1806,7 +1806,7 @@ friend class CNode;
1806
1806
mutable Mutex m_added_nodes_mutex;
1807
1807
std::vector<CNode*> m_nodes GUARDED_BY (m_nodes_mutex);
1808
1808
std::list<CNode*> m_nodes_disconnected;
1809
- mutable RecursiveMutex m_nodes_mutex;
1809
+ mutable Mutex m_nodes_mutex;
1810
1810
std::atomic<NodeId> nLastNodeId{0 };
1811
1811
unsigned int nPrevNodeCount{0 };
1812
1812
@@ -1993,7 +1993,7 @@ friend class CNode;
1993
1993
std::list<ReconnectionInfo> m_reconnections GUARDED_BY (m_reconnections_mutex);
1994
1994
1995
1995
/* * Attempt reconnections, if m_reconnections non-empty. */
1996
- void PerformReconnections () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc, !m_reconnections_mutex, !m_unused_i2p_sessions_mutex);
1996
+ void PerformReconnections () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc, !m_reconnections_mutex, !m_unused_i2p_sessions_mutex, !m_nodes_mutex );
1997
1997
1998
1998
/* *
1999
1999
* Cap on the size of `m_unused_i2p_sessions`, to ensure it does not
0 commit comments