mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Merge 4c40837a45 into merged_master (Bitcoin PR bitcoin/bitcoin#27412)
This commit is contained in:
commit
60599d974e
3 changed files with 13 additions and 4 deletions
|
|
@ -2614,6 +2614,11 @@ size_t CConnman::GetNodeCount(ConnectionDirection flags) const
|
|||
return nNum;
|
||||
}
|
||||
|
||||
uint32_t CConnman::GetMappedAS(const CNetAddr& addr) const
|
||||
{
|
||||
return m_netgroupman.GetMappedAS(addr);
|
||||
}
|
||||
|
||||
void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats) const
|
||||
{
|
||||
vstats.clear();
|
||||
|
|
@ -2622,7 +2627,7 @@ void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats) const
|
|||
for (CNode* pnode : m_nodes) {
|
||||
vstats.emplace_back();
|
||||
pnode->CopyStats(vstats.back());
|
||||
vstats.back().m_mapped_as = m_netgroupman.GetMappedAS(pnode->addr);
|
||||
vstats.back().m_mapped_as = GetMappedAS(pnode->addr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -852,6 +852,7 @@ public:
|
|||
bool AddConnection(const std::string& address, ConnectionType conn_type) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex);
|
||||
|
||||
size_t GetNodeCount(ConnectionDirection) const;
|
||||
uint32_t GetMappedAS(const CNetAddr& addr) const;
|
||||
void GetNodeStats(std::vector<CNodeStats>& vstats) const;
|
||||
bool DisconnectNode(const std::string& node);
|
||||
bool DisconnectNode(const CSubNet& subnet);
|
||||
|
|
|
|||
|
|
@ -3414,10 +3414,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;
|
||||
|
|
@ -3457,9 +3458,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
Add a link
Reference in a new issue