mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-10 20:53:50 +01:00
tracing: add inbound connection eviction tracepoint
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
|
||||
TRACEPOINT_SEMAPHORE(net, evicted_inbound_connection);
|
||||
TRACEPOINT_SEMAPHORE(net, inbound_connection);
|
||||
TRACEPOINT_SEMAPHORE(net, outbound_connection);
|
||||
TRACEPOINT_SEMAPHORE(net, outbound_message);
|
||||
@@ -1710,6 +1711,12 @@ bool CConnman::AttemptToEvictConnection()
|
||||
for (CNode* pnode : m_nodes) {
|
||||
if (pnode->GetId() == *node_id_to_evict) {
|
||||
LogDebug(BCLog::NET, "selected %s connection for eviction, %s", pnode->ConnectionTypeAsString(), pnode->DisconnectMsg(fLogIPs));
|
||||
TRACEPOINT(net, evicted_inbound_connection,
|
||||
pnode->GetId(),
|
||||
pnode->m_addr_name.c_str(),
|
||||
pnode->ConnectionTypeAsString().c_str(),
|
||||
pnode->ConnectedThroughNetwork(),
|
||||
Ticks<std::chrono::seconds>(pnode->m_connected));
|
||||
pnode->fDisconnect = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user