From e6d141afd48838ff5243afe7c545f282d832833d Mon Sep 17 00:00:00 2001 From: Jameson Lopp Date: Mon, 5 Feb 2024 16:03:21 -1000 Subject: [PATCH] fix sent message stats --- src/net.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index dec5af7ef103a..9006d41919759 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -3831,6 +3831,9 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg) CaptureMessage(pnode->addr, msg.m_type, msg.data, /*is_incoming=*/false); } + statsClient.count("bandwidth.message." + SanitizeString(msg.m_type.c_str()) + ".bytesSent", nMessageSize, 1.0f); + statsClient.inc("message.sent." + SanitizeString(msg.m_type.c_str()), 1.0f); + TRACE6(net, outbound_message, pnode->GetId(), pnode->m_addr_name.c_str(), @@ -3867,9 +3870,6 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg) } } if (nBytesSent) RecordBytesSent(nBytesSent); - - statsClient.count("bandwidth.message." + SanitizeString(msg.m_type.c_str()) + ".bytesSent", nBytesSent, 1.0f); - statsClient.inc("message.sent." + SanitizeString(msg.m_type.c_str()), 1.0f); } bool CConnman::ForNode(NodeId id, std::function func)