@@ -652,7 +652,7 @@ class CNode
652
652
* @return True if the peer should stay connected,
653
653
* False if the peer should be disconnected from.
654
654
*/
655
- bool ReceiveMsgBytes (Span<const uint8_t > msg_bytes, bool & complete);
655
+ bool ReceiveMsgBytes (Span<const uint8_t > msg_bytes, bool & complete) EXCLUSIVE_LOCKS_REQUIRED(!cs_vRecv) ;
656
656
657
657
void SetCommonVersion (int greatest_common_version)
658
658
{
@@ -664,9 +664,9 @@ class CNode
664
664
return m_greatest_common_version;
665
665
}
666
666
667
- CService GetAddrLocal () const LOCKS_EXCLUDED( m_addr_local_mutex);
667
+ CService GetAddrLocal () const EXCLUSIVE_LOCKS_REQUIRED(! m_addr_local_mutex);
668
668
// ! May not be called more than once
669
- void SetAddrLocal (const CService& addrLocalIn) LOCKS_EXCLUDED( m_addr_local_mutex);
669
+ void SetAddrLocal (const CService& addrLocalIn) EXCLUSIVE_LOCKS_REQUIRED(! m_addr_local_mutex);
670
670
671
671
CNode* AddRef ()
672
672
{
@@ -679,9 +679,9 @@ class CNode
679
679
nRefCount--;
680
680
}
681
681
682
- void CloseSocketDisconnect (CConnman* connman);
682
+ void CloseSocketDisconnect (CConnman* connman) EXCLUSIVE_LOCKS_REQUIRED(!cs_hSocket) ;
683
683
684
- void copyStats (CNodeStats &stats, const std::vector<bool > &m_asmap);
684
+ void copyStats (CNodeStats &stats, const std::vector<bool > &m_asmap) EXCLUSIVE_LOCKS_REQUIRED(!m_subver_mutex, !m_addr_local_mutex, !cs_vSend, !cs_vRecv) ;
685
685
686
686
ServiceFlags GetLocalServices () const
687
687
{
@@ -857,7 +857,7 @@ friend class CNode;
857
857
bool m_i2p_accept_incoming;
858
858
};
859
859
860
- void Init (const Options& connOptions) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
860
+ void Init (const Options& connOptions) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex, ! m_total_bytes_sent_mutex)
861
861
{
862
862
AssertLockNotHeld (m_total_bytes_sent_mutex);
863
863
@@ -891,7 +891,8 @@ friend class CNode;
891
891
CConnman (uint64_t seed0, uint64_t seed1, CAddrMan& addrman, bool network_active = true );
892
892
~CConnman ();
893
893
bool Start (CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_metaman, CMasternodeSync& mn_sync,
894
- CScheduler& scheduler, const Options& options) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex);
894
+ CScheduler& scheduler, const Options& options)
895
+ EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex, !m_added_nodes_mutex, !m_addr_fetches_mutex, !mutexMsgProc);
895
896
896
897
void StopThreads ();
897
898
void StopNodes ();
@@ -901,7 +902,7 @@ friend class CNode;
901
902
StopNodes ();
902
903
};
903
904
904
- void Interrupt ();
905
+ void Interrupt () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc) ;
905
906
bool GetNetworkActive () const { return fNetworkActive ; };
906
907
bool GetUseAddrmanOutgoing () const { return m_use_addrman_outgoing; };
907
908
void SetNetworkActive (bool active, CMasternodeSync* const mn_sync);
@@ -917,8 +918,13 @@ friend class CNode;
917
918
IsConnection,
918
919
};
919
920
920
- void OpenNetworkConnection (const CAddress& addrConnect, bool fCountFailure , CSemaphoreGrant* grantOutbound, const char * strDest, ConnectionType conn_type, MasternodeConn masternode_connection = MasternodeConn::IsNotConnection, MasternodeProbeConn masternode_probe_connection = MasternodeProbeConn::IsNotConnection);
921
- void OpenMasternodeConnection (const CAddress& addrConnect, MasternodeProbeConn probe = MasternodeProbeConn::IsConnection);
921
+ void OpenNetworkConnection (const CAddress& addrConnect, bool fCountFailure , CSemaphoreGrant* grantOutbound,
922
+ const char * strDest, ConnectionType conn_type,
923
+ MasternodeConn masternode_connection = MasternodeConn::IsNotConnection,
924
+ MasternodeProbeConn masternode_probe_connection = MasternodeProbeConn::IsNotConnection)
925
+ EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
926
+ void OpenMasternodeConnection (const CAddress& addrConnect, MasternodeProbeConn probe = MasternodeProbeConn::IsConnection)
927
+ EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
922
928
bool CheckIncomingNonce (uint64_t nonce);
923
929
924
930
struct CFullyConnectedOnly {
@@ -959,7 +965,8 @@ friend class CNode;
959
965
960
966
bool IsMasternodeOrDisconnectRequested (const CService& addr);
961
967
962
- void PushMessage (CNode* pnode, CSerializedNetMsg&& msg) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex);
968
+ void PushMessage (CNode* pnode, CSerializedNetMsg&& msg)
969
+ EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc, !m_total_bytes_sent_mutex);
963
970
964
971
template <typename Condition, typename Callable>
965
972
bool ForEachNodeContinueIf (const Condition& cond, Callable&& func)
@@ -1099,9 +1106,9 @@ friend class CNode;
1099
1106
// Count the number of block-relay-only peers we have over our limit.
1100
1107
int GetExtraBlockRelayCount () const ;
1101
1108
1102
- bool AddNode (const std::string& node);
1103
- bool RemoveAddedNode (const std::string& node);
1104
- std::vector<AddedNodeInfo> GetAddedNodeInfo () const ;
1109
+ bool AddNode (const std::string& node) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex) ;
1110
+ bool RemoveAddedNode (const std::string& node) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex) ;
1111
+ std::vector<AddedNodeInfo> GetAddedNodeInfo () const EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex) ;
1105
1112
1106
1113
/* *
1107
1114
* Attempts to open a connection. Currently only used from tests.
@@ -1114,7 +1121,7 @@ friend class CNode;
1114
1121
* - Max total outbound connection capacity filled
1115
1122
* - Max connection capacity for type is filled
1116
1123
*/
1117
- bool AddConnection (const std::string& address, ConnectionType conn_type);
1124
+ bool AddConnection (const std::string& address, ConnectionType conn_type) EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc) ;
1118
1125
1119
1126
bool AddPendingMasternode (const uint256& proTxHash);
1120
1127
void SetMasternodeQuorumNodes (Consensus::LLMQType llmqType, const uint256& quorumHash, const std::set<uint256>& proTxHashes);
@@ -1166,8 +1173,8 @@ friend class CNode;
1166
1173
1167
1174
unsigned int GetReceiveFloodSize () const ;
1168
1175
1169
- void WakeMessageHandler ();
1170
- void WakeSelect ();
1176
+ void WakeMessageHandler () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc) ;
1177
+ void WakeSelect () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc) ;
1171
1178
1172
1179
/* * Attempts to obfuscate tx time through exponentially distributed emitting.
1173
1180
Works assuming that a single interval is used.
@@ -1221,13 +1228,15 @@ friend class CNode;
1221
1228
const std::vector<NetWhitebindPermissions>& whiteBinds,
1222
1229
const std::vector<CService>& onion_binds);
1223
1230
1224
- void ThreadOpenAddedConnections ();
1225
- void AddAddrFetch (const std::string& strDest);
1226
- void ProcessAddrFetch ();
1227
- void ThreadOpenConnections (const std::vector<std::string> connect, CDeterministicMNManager& dmnman);
1228
- void ThreadMessageHandler ();
1229
- void ThreadI2PAcceptIncoming (CMasternodeSync& mn_sync);
1230
- void AcceptConnection (const ListenSocket& hListenSocket, CMasternodeSync& mn_sync);
1231
+ void ThreadOpenAddedConnections () EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex, !mutexMsgProc);
1232
+ void AddAddrFetch (const std::string& strDest) EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex);
1233
+ void ProcessAddrFetch () EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex, !mutexMsgProc);
1234
+ void ThreadOpenConnections (const std::vector<std::string> connect, CDeterministicMNManager& dmnman)
1235
+ EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex, !m_added_nodes_mutex, !m_nodes_mutex, !mutexMsgProc);
1236
+ void ThreadMessageHandler () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
1237
+ void ThreadI2PAcceptIncoming (CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
1238
+ void AcceptConnection (const ListenSocket& hListenSocket, CMasternodeSync& mn_sync)
1239
+ EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
1231
1240
1232
1241
/* *
1233
1242
* Create a `CNode` object from a socket that has just been accepted and add the node to
@@ -1241,7 +1250,7 @@ friend class CNode;
1241
1250
NetPermissionFlags permissionFlags,
1242
1251
const CAddress& addr_bind,
1243
1252
const CAddress& addr,
1244
- CMasternodeSync& mn_sync);
1253
+ CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc) ;
1245
1254
1246
1255
void DisconnectNodes ();
1247
1256
void NotifyNumConnectionsChanged (CMasternodeSync& mn_sync);
@@ -1305,7 +1314,7 @@ friend class CNode;
1305
1314
/* *
1306
1315
* Check connected and listening sockets for IO readiness and process them accordingly.
1307
1316
*/
1308
- void SocketHandler (CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex);
1317
+ void SocketHandler (CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex, !mutexMsgProc );
1309
1318
1310
1319
/* *
1311
1320
* Do the read/write for connected sockets that are ready for IO.
@@ -1316,18 +1325,20 @@ friend class CNode;
1316
1325
void SocketHandlerConnected (const std::set<SOCKET>& recv_set,
1317
1326
const std::set<SOCKET>& send_set,
1318
1327
const std::set<SOCKET>& error_set)
1319
- EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex);
1328
+ EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex, !mutexMsgProc );
1320
1329
1321
1330
/* *
1322
1331
* Accept incoming connections, one from each read-ready listening socket.
1323
1332
* @param[in] recv_set Sockets that are ready for read.
1324
1333
*/
1325
- void SocketHandlerListening (const std::set<SOCKET>& recv_set, CMasternodeSync& mn_sync);
1334
+ void SocketHandlerListening (const std::set<SOCKET>& recv_set, CMasternodeSync& mn_sync)
1335
+ EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
1326
1336
1327
- void ThreadSocketHandler (CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex);
1328
- void ThreadDNSAddressSeed ();
1337
+ void ThreadSocketHandler (CMasternodeSync& mn_sync) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex, !mutexMsgProc );
1338
+ void ThreadDNSAddressSeed () EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex, !m_nodes_mutex) ;
1329
1339
void ThreadOpenMasternodeConnections (CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_metaman,
1330
- CMasternodeSync& mn_sync);
1340
+ CMasternodeSync& mn_sync)
1341
+ EXCLUSIVE_LOCKS_REQUIRED(!m_addr_fetches_mutex, !m_nodes_mutex, !mutexMsgProc);
1331
1342
1332
1343
uint64_t CalculateKeyedNetGroup (const CAddress& ad) const ;
1333
1344
@@ -1351,7 +1362,7 @@ friend class CNode;
1351
1362
NodeId GetNewNodeId ();
1352
1363
1353
1364
size_t SocketSendData (CNode& node) EXCLUSIVE_LOCKS_REQUIRED(node.cs_vSend);
1354
- size_t SocketRecvData (CNode* pnode);
1365
+ size_t SocketRecvData (CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc) ;
1355
1366
void DumpAddresses ();
1356
1367
1357
1368
// Network stats
0 commit comments