aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2023-09-26 18:07:36 -0400
committerPieter Wuille <pieter@wuille.net>2023-10-02 18:09:53 -0400
commita4706bc877504057e8522c929cc0704d3eaa7302 (patch)
tree9de2ac46f58890a0ce845ae0a101c6280178c86b /src
parentabf343b32026c3f8246f98c416e2c6cf5b66aa38 (diff)
downloadbitcoin-a4706bc877504057e8522c929cc0704d3eaa7302.tar.xz
rpc: don't report v2 handshake bytes in the per-type sent byte statistics
This matches the behavior for per-type received bytes.
Diffstat (limited to 'src')
-rw-r--r--src/net.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index df8f3acfd1..72aef92e62 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1609,7 +1609,9 @@ std::pair<size_t, bool> 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