aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-09-02 12:32:49 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-09-02 12:51:56 +0200
commitcbe9ae8c69b947c8cdff2e0fbf5b57c9aa09b770 (patch)
treeda34cdef9c97e3bb18178dfd7733f21937942d3d
parent381d0ddc8aaa5519c18b8eb8fd59db798546af44 (diff)
parentb7c349d5e7c207bb7a2e7469c3e5522c9909c17f (diff)
Merge #8466: [Trivial] Do not shadow variables in networking code
b7c349d Do not shadow variables in networking code (Pavel Janík)
-rw-r--r--src/net.cpp2
-rw-r--r--src/net.h12
-rw-r--r--src/netaddress.cpp4
-rw-r--r--src/netbase.cpp6
-rw-r--r--src/netbase.h2
5 files changed, 13 insertions, 13 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 957388b8fd..c5b080f794 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -70,7 +70,7 @@ namespace {
SOCKET socket;
bool whitelisted;
- ListenSocket(SOCKET socket, bool whitelisted) : socket(socket), whitelisted(whitelisted) {}
+ ListenSocket(SOCKET _socket, bool _whitelisted) : socket(_socket), whitelisted(_whitelisted) {}
};
}
diff --git a/src/net.h b/src/net.h
index 1ba2d47da7..b9cc81e4e9 100644
--- a/src/net.h
+++ b/src/net.h
@@ -512,21 +512,21 @@ public:
- void AddAddressKnown(const CAddress& addr)
+ void AddAddressKnown(const CAddress& _addr)
{
- addrKnown.insert(addr.GetKey());
+ addrKnown.insert(_addr.GetKey());
}
- void PushAddress(const CAddress& addr)
+ void PushAddress(const CAddress& _addr)
{
// Known checking here is only to save space from duplicates.
// SendMessages will filter it again for knowns that were added
// after addresses were pushed.
- if (addr.IsValid() && !addrKnown.contains(addr.GetKey())) {
+ if (_addr.IsValid() && !addrKnown.contains(_addr.GetKey())) {
if (vAddrToSend.size() >= MAX_ADDR_TO_SEND) {
- vAddrToSend[insecure_rand() % vAddrToSend.size()] = addr;
+ vAddrToSend[insecure_rand() % vAddrToSend.size()] = _addr;
} else {
- vAddrToSend.push_back(addr);
+ vAddrToSend.push_back(_addr);
}
}
}
diff --git a/src/netaddress.cpp b/src/netaddress.cpp
index 7000ce3f0a..db5cc3bc20 100644
--- a/src/netaddress.cpp
+++ b/src/netaddress.cpp
@@ -197,8 +197,8 @@ bool CNetAddr::IsValid() const
return false;
// unspecified IPv6 address (::/128)
- unsigned char ipNone[16] = {};
- if (memcmp(ip, ipNone, 16) == 0)
+ unsigned char ipNone6[16] = {};
+ if (memcmp(ip, ipNone6, 16) == 0)
return false;
// documentation IPv6 address
diff --git a/src/netbase.cpp b/src/netbase.cpp
index 4f243ec6f5..7d7f1b6788 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -631,8 +631,8 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest
SplitHostPort(std::string(pszDest), port, strDest);
- proxyType nameProxy;
- GetNameProxy(nameProxy);
+ proxyType proxy;
+ GetNameProxy(proxy);
std::vector<CService> addrResolved;
if (Lookup(strDest.c_str(), addrResolved, port, fNameLookup && !HaveNameProxy(), 256)) {
@@ -646,7 +646,7 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest
if (!HaveNameProxy())
return false;
- return ConnectThroughProxy(nameProxy, strDest, port, hSocketRet, nTimeout, outProxyConnectionFailed);
+ return ConnectThroughProxy(proxy, strDest, port, hSocketRet, nTimeout, outProxyConnectionFailed);
}
bool LookupSubNet(const char* pszName, CSubNet& ret)
diff --git a/src/netbase.h b/src/netbase.h
index bb12019a82..eb39d16578 100644
--- a/src/netbase.h
+++ b/src/netbase.h
@@ -29,7 +29,7 @@ class proxyType
{
public:
proxyType(): randomize_credentials(false) {}
- proxyType(const CService &proxy, bool randomize_credentials=false): proxy(proxy), randomize_credentials(randomize_credentials) {}
+ proxyType(const CService &_proxy, bool _randomize_credentials=false): proxy(_proxy), randomize_credentials(_randomize_credentials) {}
bool IsValid() const { return proxy.IsValid(); }