diff options
author | brunoerg <brunoely.gc@gmail.com> | 2023-04-03 17:09:30 -0300 |
---|---|---|
committer | brunoerg <brunoely.gc@gmail.com> | 2023-04-04 16:53:25 -0300 |
commit | 0076bed45eb2b42111fa3f4c95181393c685a42e (patch) | |
tree | a62a30b7ed5a174fd724c9023ee6d1cfaaa179b8 /src/net_processing.cpp | |
parent | 9836c76ae048698e4f7dab21e3be37313e8392ae (diff) |
logging: log ASN when using `-asmap`
When using `-asmap`, it will log the ASN from the peer on some logs (e.g. when a new outbound peer has been connected).
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r-- | src/net_processing.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 2348f6c059..2d75c67345 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -3367,10 +3367,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, if (fLogIPs) remoteAddr = ", peeraddr=" + pfrom.addr.ToStringAddrPort(); - LogPrint(BCLog::NET, "receive version message: %s: version %d, blocks=%d, us=%s, txrelay=%d, peer=%d%s\n", + const auto mapped_as{m_connman.GetMappedAS(pfrom.addr)}; + LogPrint(BCLog::NET, "receive version message: %s: version %d, blocks=%d, us=%s, txrelay=%d, peer=%d%s%s\n", cleanSubVer, pfrom.nVersion, peer->m_starting_height, addrMe.ToStringAddrPort(), fRelay, pfrom.GetId(), - remoteAddr); + remoteAddr, (mapped_as ? strprintf(", mapped_as=%d", mapped_as) : "")); int64_t nTimeOffset = nTime - GetTime(); pfrom.nTimeOffset = nTimeOffset; @@ -3410,9 +3411,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, } if (!pfrom.IsInboundConn()) { - LogPrintf("New outbound peer connected: version: %d, blocks=%d, peer=%d%s (%s)\n", + const auto mapped_as{m_connman.GetMappedAS(pfrom.addr)}; + LogPrintf("New outbound peer connected: version: %d, blocks=%d, peer=%d%s%s (%s)\n", pfrom.nVersion.load(), peer->m_starting_height, pfrom.GetId(), (fLogIPs ? strprintf(", peeraddr=%s", pfrom.addr.ToStringAddrPort()) : ""), + (mapped_as ? strprintf(", mapped_as=%d", mapped_as) : ""), pfrom.ConnectionTypeAsString()); } |