aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authordergoegge <n.goeggi@gmail.com>2023-03-14 17:48:32 +0100
committerdergoegge <n.goeggi@gmail.com>2023-03-22 13:18:57 +0100
commit3eac5e7cd1eda6ababb9af9cd72dae08d395993d (patch)
tree428a3867043c8e81cb8bb8d84345de588cecfd67 /src/net.h
parent60441a3432df10f5d7c15c09c9569f27a793625b (diff)
[net] Add CNode helper for send byte accounting
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index 7b1b7b4159..67cae64ef6 100644
--- a/src/net.h
+++ b/src/net.h
@@ -430,6 +430,13 @@ public:
std::optional<std::pair<CNetMessage, bool>> PollMessage(size_t recv_flood_size)
EXCLUSIVE_LOCKS_REQUIRED(!m_msg_process_queue_mutex);
+ /** Account for the total size of a sent message in the per msg type connection stats. */
+ void AccountForSentBytes(const std::string& msg_type, size_t sent_bytes)
+ EXCLUSIVE_LOCKS_REQUIRED(cs_vSend)
+ {
+ mapSendBytesPerMsgType[msg_type] += sent_bytes;
+ }
+
bool IsOutboundOrBlockRelayConn() const {
switch (m_conn_type) {
case ConnectionType::OUTBOUND_FULL_RELAY: