mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
merge bitcoin#24079: replace RecursiveMutex cs_SubVer with Mutex (and rename)
This commit is contained in:
parent
23b152cd37
commit
2f7a138452
@ -648,7 +648,7 @@ void CNode::copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap)
|
||||
X(m_addr_name);
|
||||
X(nVersion);
|
||||
{
|
||||
LOCK(cs_SubVer);
|
||||
LOCK(m_subver_mutex);
|
||||
X(cleanSubVer);
|
||||
}
|
||||
stats.fInbound = IsInboundConn();
|
||||
|
@ -476,12 +476,12 @@ public:
|
||||
const bool m_inbound_onion;
|
||||
std::atomic<int> nNumWarningsSkipped{0};
|
||||
std::atomic<int> nVersion{0};
|
||||
Mutex m_subver_mutex;
|
||||
/**
|
||||
* cleanSubVer is a sanitized string of the user agent byte array we read
|
||||
* from the wire. This cleaned string can safely be logged or displayed.
|
||||
*/
|
||||
std::string cleanSubVer GUARDED_BY(cs_SubVer){};
|
||||
RecursiveMutex cs_SubVer; // used for both cleanSubVer and strSubVer
|
||||
std::string cleanSubVer GUARDED_BY(m_subver_mutex){};
|
||||
bool m_prefer_evict{false}; // This peer is preferred for eviction.
|
||||
bool HasPermission(NetPermissionFlags permission) const {
|
||||
return NetPermissions::HasFlag(m_permissionFlags, permission);
|
||||
|
@ -3357,7 +3357,7 @@ void PeerManagerImpl::ProcessMessage(
|
||||
pfrom.nServices = nServices;
|
||||
pfrom.SetAddrLocal(addrMe);
|
||||
{
|
||||
LOCK(pfrom.cs_SubVer);
|
||||
LOCK(pfrom.m_subver_mutex);
|
||||
pfrom.cleanSubVer = cleanSubVer;
|
||||
}
|
||||
peer->m_starting_height = starting_height;
|
||||
|
Loading…
Reference in New Issue
Block a user