mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
net: No longer send local address in addrMe
After #8594 the addrFrom sent by a node is not used anymore at all,
so don't bother sending it.
Also mitigates the privacy issue in (#8616). It doesn't completely solve
the issue as GetLocalAddress is also called in AdvertiseLocal, but at
least when advertising addresses it stands out less as *our* address.
Github-Pull: #8740
Rebased-From: d9c99c3058
This commit is contained in:
committed by
Luke Dashjr
parent
ea51b0f5dd
commit
42ea51a65f
@@ -499,7 +499,7 @@ void CNode::PushVersion()
|
|||||||
|
|
||||||
int64_t nTime = (fInbound ? GetAdjustedTime() : GetTime());
|
int64_t nTime = (fInbound ? GetAdjustedTime() : GetTime());
|
||||||
CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService("0.0.0.0", 0), addr.nServices));
|
CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService("0.0.0.0", 0), addr.nServices));
|
||||||
CAddress addrMe = GetLocalAddress(&addr);
|
CAddress addrMe = CAddress(CService(), nLocalServices);
|
||||||
GetRandBytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce));
|
GetRandBytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce));
|
||||||
if (fLogIPs)
|
if (fLogIPs)
|
||||||
LogPrint("net", "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), addrYou.ToString(), id);
|
LogPrint("net", "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), addrYou.ToString(), id);
|
||||||
|
|||||||
Reference in New Issue
Block a user