Skip to content

Commit

Permalink
Merge pull request #2459 from Pythonix/net-fix
Browse files Browse the repository at this point in the history
net: No longer send local address in addrMe
  • Loading branch information
jamescowens committed Apr 17, 2022
2 parents ff5c6ef + f749f19 commit 8a89e94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3580,7 +3580,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
}

// record my external IP reported by peer
if (addrFrom.IsRoutable() && addrMe.IsRoutable())
if (addrMe.IsRoutable())
addrSeenByPeer = addrMe;

// Be shy and don't send version until we hear
Expand Down
2 changes: 1 addition & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ void CNode::PushVersion()
{
int64_t nTime = GetAdjustedTime();
CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService("0.0.0.0",0)));
CAddress addrMe = GetLocalAddress(&addr);
CAddress addrMe = CAddress(CService(), nLocalServices);
GetRandBytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce));
LogPrint(BCLog::LogFlags::NET, "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%s",
PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), addrYou.ToString(), addr.ToString());
Expand Down

0 comments on commit 8a89e94

Please sign in to comment.