tracing: add misbehaving conn tracepoint

This commit is contained in:
0xb10c
2022-05-02 16:30:15 +02:00
committed by 0xb10c
parent 68c1ef4f19
commit b2ad6ede95
3 changed files with 81 additions and 2 deletions

View File

@@ -58,6 +58,7 @@
using namespace util::hex_literals;
TRACEPOINT_SEMAPHORE(net, inbound_message);
TRACEPOINT_SEMAPHORE(net, misbehaving_connection);
/** Headers download timeout.
* Timeout = base + per_header * (expected number of headers) */
@@ -1752,6 +1753,10 @@ void PeerManagerImpl::Misbehaving(Peer& peer, const std::string& message)
const std::string message_prefixed = message.empty() ? "" : (": " + message);
peer.m_should_discourage = true;
LogDebug(BCLog::NET, "Misbehaving: peer=%d%s\n", peer.m_id, message_prefixed);
TRACEPOINT(net, misbehaving_connection,
peer.m_id,
message.c_str()
);
}
void PeerManagerImpl::MaybePunishNodeForBlock(NodeId nodeid, const BlockValidationState& state,