From a4706bc877504057e8522c929cc0704d3eaa7302 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Tue, 26 Sep 2023 18:07:36 -0400 Subject: [PATCH] rpc: don't report v2 handshake bytes in the per-type sent byte statistics This matches the behavior for per-type received bytes. --- src/net.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index df8f3acfd1e..72aef92e62b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1609,7 +1609,9 @@ std::pair CConnman::SocketSendData(CNode& node) const // Notify transport that bytes have been processed. node.m_transport->MarkBytesSent(nBytes); // Update statistics per message type. - node.AccountForSentBytes(msg_type, nBytes); + if (!msg_type.empty()) { // don't report v2 handshake bytes for now + node.AccountForSentBytes(msg_type, nBytes); + } nSentSize += nBytes; if ((size_t)nBytes != data.size()) { // could not send full message; stop sending more