File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2860,7 +2860,7 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)
28602860 bool optimisticSend (pnode->vSendMsg .empty ());
28612861
28622862 // log total amount of bytes per message type
2863- pnode->mapSendBytesPerMsgType [ msg.m_type ] += nTotalSize;
2863+ pnode->AccountForSentBytes ( msg.m_type , nTotalSize) ;
28642864 pnode->nSendSize += nTotalSize;
28652865
28662866 if (pnode->nSendSize > nSendBufferMaxSize) pnode->fPauseSend = true ;
Original file line number Diff line number Diff line change @@ -430,6 +430,13 @@ class CNode
430430 std::optional<std::pair<CNetMessage, bool >> PollMessage (size_t recv_flood_size)
431431 EXCLUSIVE_LOCKS_REQUIRED(!m_msg_process_queue_mutex);
432432
433+ /* * Account for the total size of a sent message in the per msg type connection stats. */
434+ void AccountForSentBytes (const std::string& msg_type, size_t sent_bytes)
435+ EXCLUSIVE_LOCKS_REQUIRED(cs_vSend)
436+ {
437+ mapSendBytesPerMsgType[msg_type] += sent_bytes;
438+ }
439+
433440 bool IsOutboundOrBlockRelayConn () const {
434441 switch (m_conn_type) {
435442 case ConnectionType::OUTBOUND_FULL_RELAY:
You can’t perform that action at this time.
0 commit comments