Skip to content

Commit

Permalink
net: No longer send local address in addrMe
Browse files Browse the repository at this point in the history
After bitcoin#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 (bitcoin#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: bitcoin#8740
Rebased-From: d9c99c3
  • Loading branch information
laanwj authored and luke-jr committed Sep 21, 2016
1 parent ea51b0f commit 42ea51a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ void CNode::PushVersion()

int64_t nTime = (fInbound ? GetAdjustedTime() : GetTime());
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));
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);
Expand Down

0 comments on commit 42ea51a

Please sign in to comment.