mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
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:
parent
9836c76ae0
commit
0076bed45e
1 changed files with 6 additions and 3 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue