mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Merge #8466: [Trivial] Do not shadow variables in networking code
b7c349d Do not shadow variables in networking code (Pavel Janík)
This commit is contained in:
12
src/net.h
12
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user