mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +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(m_addr_name);
|
||||||
X(nVersion);
|
X(nVersion);
|
||||||
{
|
{
|
||||||
LOCK(cs_SubVer);
|
LOCK(m_subver_mutex);
|
||||||
X(cleanSubVer);
|
X(cleanSubVer);
|
||||||
}
|
}
|
||||||
stats.fInbound = IsInboundConn();
|
stats.fInbound = IsInboundConn();
|
||||||
|
@ -476,12 +476,12 @@ public:
|
|||||||
const bool m_inbound_onion;
|
const bool m_inbound_onion;
|
||||||
std::atomic<int> nNumWarningsSkipped{0};
|
std::atomic<int> nNumWarningsSkipped{0};
|
||||||
std::atomic<int> nVersion{0};
|
std::atomic<int> nVersion{0};
|
||||||
|
Mutex m_subver_mutex;
|
||||||
/**
|
/**
|
||||||
* cleanSubVer is a sanitized string of the user agent byte array we read
|
* 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.
|
* from the wire. This cleaned string can safely be logged or displayed.
|
||||||
*/
|
*/
|
||||||
std::string cleanSubVer GUARDED_BY(cs_SubVer){};
|
std::string cleanSubVer GUARDED_BY(m_subver_mutex){};
|
||||||
RecursiveMutex cs_SubVer; // used for both cleanSubVer and strSubVer
|
|
||||||
bool m_prefer_evict{false}; // This peer is preferred for eviction.
|
bool m_prefer_evict{false}; // This peer is preferred for eviction.
|
||||||
bool HasPermission(NetPermissionFlags permission) const {
|
bool HasPermission(NetPermissionFlags permission) const {
|
||||||
return NetPermissions::HasFlag(m_permissionFlags, permission);
|
return NetPermissions::HasFlag(m_permissionFlags, permission);
|
||||||
|
@ -3357,7 +3357,7 @@ void PeerManagerImpl::ProcessMessage(
|
|||||||
pfrom.nServices = nServices;
|
pfrom.nServices = nServices;
|
||||||
pfrom.SetAddrLocal(addrMe);
|
pfrom.SetAddrLocal(addrMe);
|
||||||
{
|
{
|
||||||
LOCK(pfrom.cs_SubVer);
|
LOCK(pfrom.m_subver_mutex);
|
||||||
pfrom.cleanSubVer = cleanSubVer;
|
pfrom.cleanSubVer = cleanSubVer;
|
||||||
}
|
}
|
||||||
peer->m_starting_height = starting_height;
|
peer->m_starting_height = starting_height;
|
||||||
|
Loading…
Reference in New Issue
Block a user