From f749f19cc4f9a4b41ae1287cb95c89adb1bba5f5 Mon Sep 17 00:00:00 2001 From: pythonix <9782029+Pythonix@users.noreply.github.com> Date: Mon, 7 Mar 2022 21:11:42 +0100 Subject: [PATCH] No longer send local address in addrMe --- src/main.cpp | 2 +- src/net.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6f49e9e17e..5a90672ea4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3048,7 +3048,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 diff --git a/src/net.cpp b/src/net.cpp index 179fc68695..2472d12971 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -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());