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).
This commit is contained in:
1 parent
9836c76ae0
commit
0076bed45e
1 file changed
+6
-3
@@ -3367,10 +3367,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||||||
if (fLogIPs)
|
if (fLogIPs)
|
||||||
remoteAddr = ", peeraddr=" + pfrom.addr.ToStringAddrPort();
|
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,
|
cleanSubVer, pfrom.nVersion,
|
||||||
peer->m_starting_height, addrMe.ToStringAddrPort(), fRelay, pfrom.GetId(),
|
peer->m_starting_height, addrMe.ToStringAddrPort(), fRelay, pfrom.GetId(),
|
||||||
remoteAddr);
|
remoteAddr, (mapped_as ? strprintf(", mapped_as=%d", mapped_as) : ""));
|
||||||
|
|
||||||
int64_t nTimeOffset = nTime - GetTime();
|
int64_t nTimeOffset = nTime - GetTime();
|
||||||
pfrom.nTimeOffset = nTimeOffset;
|
pfrom.nTimeOffset = nTimeOffset;
|
||||||
@@ -3410,9 +3411,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!pfrom.IsInboundConn()) {
|
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.nVersion.load(), peer->m_starting_height,
|
||||||
pfrom.GetId(), (fLogIPs ? strprintf(", peeraddr=%s", pfrom.addr.ToStringAddrPort()) : ""),
|
pfrom.GetId(), (fLogIPs ? strprintf(", peeraddr=%s", pfrom.addr.ToStringAddrPort()) : ""),
|
||||||
|
(mapped_as ? strprintf(", mapped_as=%d", mapped_as) : ""),
|
||||||
pfrom.ConnectionTypeAsString());
|
pfrom.ConnectionTypeAsString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user