28
28
#endif
29
29
30
30
// Settings
31
- static RecursiveMutex cs_proxyInfos ;
32
- static proxyType proxyInfo[NET_MAX] GUARDED_BY(cs_proxyInfos );
33
- static proxyType nameProxy GUARDED_BY (cs_proxyInfos );
31
+ static Mutex g_proxyinfo_mutex ;
32
+ static proxyType proxyInfo[NET_MAX] GUARDED_BY(g_proxyinfo_mutex );
33
+ static proxyType nameProxy GUARDED_BY (g_proxyinfo_mutex );
34
34
int nConnectTimeout = DEFAULT_CONNECT_TIMEOUT;
35
35
bool fNameLookup = DEFAULT_NAME_LOOKUP;
36
36
@@ -711,14 +711,14 @@ bool SetProxy(enum Network net, const proxyType &addrProxy) {
711
711
assert (net >= 0 && net < NET_MAX);
712
712
if (!addrProxy.IsValid ())
713
713
return false ;
714
- LOCK (cs_proxyInfos );
714
+ LOCK (g_proxyinfo_mutex );
715
715
proxyInfo[net] = addrProxy;
716
716
return true ;
717
717
}
718
718
719
719
bool GetProxy (enum Network net, proxyType &proxyInfoOut) {
720
720
assert (net >= 0 && net < NET_MAX);
721
- LOCK (cs_proxyInfos );
721
+ LOCK (g_proxyinfo_mutex );
722
722
if (!proxyInfo[net].IsValid ())
723
723
return false ;
724
724
proxyInfoOut = proxyInfo[net];
@@ -744,26 +744,26 @@ bool GetProxy(enum Network net, proxyType &proxyInfoOut) {
744
744
bool SetNameProxy (const proxyType &addrProxy) {
745
745
if (!addrProxy.IsValid ())
746
746
return false ;
747
- LOCK (cs_proxyInfos );
747
+ LOCK (g_proxyinfo_mutex );
748
748
nameProxy = addrProxy;
749
749
return true ;
750
750
}
751
751
752
752
bool GetNameProxy (proxyType &nameProxyOut) {
753
- LOCK (cs_proxyInfos );
753
+ LOCK (g_proxyinfo_mutex );
754
754
if (!nameProxy.IsValid ())
755
755
return false ;
756
756
nameProxyOut = nameProxy;
757
757
return true ;
758
758
}
759
759
760
760
bool HaveNameProxy () {
761
- LOCK (cs_proxyInfos );
761
+ LOCK (g_proxyinfo_mutex );
762
762
return nameProxy.IsValid ();
763
763
}
764
764
765
765
bool IsProxy (const CNetAddr &addr) {
766
- LOCK (cs_proxyInfos );
766
+ LOCK (g_proxyinfo_mutex );
767
767
for (int i = 0 ; i < NET_MAX; i++) {
768
768
if (addr == static_cast <CNetAddr>(proxyInfo[i].proxy ))
769
769
return true ;
0 commit comments