Skip to content

Commit b7c349d

Browse files
committed
Do not shadow variables in networking code
1 parent 1030fa7 commit b7c349d

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ namespace {
6666
SOCKET socket;
6767
bool whitelisted;
6868

69-
ListenSocket(SOCKET socket, bool whitelisted) : socket(socket), whitelisted(whitelisted) {}
69+
ListenSocket(SOCKET _socket, bool _whitelisted) : socket(_socket), whitelisted(_whitelisted) {}
7070
};
7171
}
7272

src/net.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,21 +509,21 @@ class CNode
509509

510510

511511

512-
void AddAddressKnown(const CAddress& addr)
512+
void AddAddressKnown(const CAddress& _addr)
513513
{
514-
addrKnown.insert(addr.GetKey());
514+
addrKnown.insert(_addr.GetKey());
515515
}
516516

517-
void PushAddress(const CAddress& addr)
517+
void PushAddress(const CAddress& _addr)
518518
{
519519
// Known checking here is only to save space from duplicates.
520520
// SendMessages will filter it again for knowns that were added
521521
// after addresses were pushed.
522-
if (addr.IsValid() && !addrKnown.contains(addr.GetKey())) {
522+
if (_addr.IsValid() && !addrKnown.contains(_addr.GetKey())) {
523523
if (vAddrToSend.size() >= MAX_ADDR_TO_SEND) {
524-
vAddrToSend[insecure_rand() % vAddrToSend.size()] = addr;
524+
vAddrToSend[insecure_rand() % vAddrToSend.size()] = _addr;
525525
} else {
526-
vAddrToSend.push_back(addr);
526+
vAddrToSend.push_back(_addr);
527527
}
528528
}
529529
}

src/netaddress.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ bool CNetAddr::IsValid() const
197197
return false;
198198

199199
// unspecified IPv6 address (::/128)
200-
unsigned char ipNone[16] = {};
201-
if (memcmp(ip, ipNone, 16) == 0)
200+
unsigned char ipNone6[16] = {};
201+
if (memcmp(ip, ipNone6, 16) == 0)
202202
return false;
203203

204204
// documentation IPv6 address

src/netbase.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,8 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest
631631

632632
SplitHostPort(std::string(pszDest), port, strDest);
633633

634-
proxyType nameProxy;
635-
GetNameProxy(nameProxy);
634+
proxyType proxy;
635+
GetNameProxy(proxy);
636636

637637
std::vector<CService> addrResolved;
638638
if (Lookup(strDest.c_str(), addrResolved, port, fNameLookup && !HaveNameProxy(), 256)) {
@@ -646,7 +646,7 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest
646646

647647
if (!HaveNameProxy())
648648
return false;
649-
return ConnectThroughProxy(nameProxy, strDest, port, hSocketRet, nTimeout, outProxyConnectionFailed);
649+
return ConnectThroughProxy(proxy, strDest, port, hSocketRet, nTimeout, outProxyConnectionFailed);
650650
}
651651

652652
bool LookupSubNet(const char* pszName, CSubNet& ret)

src/netbase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class proxyType
2929
{
3030
public:
3131
proxyType(): randomize_credentials(false) {}
32-
proxyType(const CService &proxy, bool randomize_credentials=false): proxy(proxy), randomize_credentials(randomize_credentials) {}
32+
proxyType(const CService &_proxy, bool _randomize_credentials=false): proxy(_proxy), randomize_credentials(_randomize_credentials) {}
3333

3434
bool IsValid() const { return proxy.IsValid(); }
3535

0 commit comments

Comments
 (0)