rpc: don't report v2 handshake bytes in the per-type sent byte statistics

This matches the behavior for per-type received bytes.
This commit is contained in:
Sebastian Falbesoner 2023-09-26 18:07:36 -04:00 committed by Pieter Wuille
parent abf343b320
commit a4706bc877

View File

@ -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