@@ -102,7 +102,7 @@ enum BindFlags {
102
102
// The sleep time needs to be small to avoid new sockets stalling
103
103
static const uint64_t SELECT_TIMEOUT_MILLISECONDS = 50 ;
104
104
105
- const std::string NET_MESSAGE_COMMAND_OTHER = " *other*" ;
105
+ const std::string NET_MESSAGE_TYPE_OTHER = " *other*" ;
106
106
107
107
static const uint64_t RANDOMIZER_ID_NETGROUP = 0x6c0edd8036ef4036ULL ; // SHA256("netgroup")[0:8]
108
108
static const uint64_t RANDOMIZER_ID_LOCALHOSTNONCE = 0xd93e69e2bbfa5735ULL ; // SHA256("localhostnonce")[0:8]
@@ -605,12 +605,12 @@ void CNode::CopyStats(CNodeStats& stats)
605
605
X (m_bip152_highbandwidth_from);
606
606
{
607
607
LOCK (cs_vSend);
608
- X (mapSendBytesPerMsgCmd );
608
+ X (mapSendBytesPerMsgType );
609
609
X (nSendBytes);
610
610
}
611
611
{
612
612
LOCK (cs_vRecv);
613
- X (mapRecvBytesPerMsgCmd );
613
+ X (mapRecvBytesPerMsgType );
614
614
X (nRecvBytes);
615
615
}
616
616
X (m_permissionFlags);
@@ -653,17 +653,17 @@ bool CNode::ReceiveMsgBytes(Span<const uint8_t> msg_bytes, bool& complete)
653
653
if (reject_message) {
654
654
// Message deserialization failed. Drop the message but don't disconnect the peer.
655
655
// store the size of the corrupt message
656
- mapRecvBytesPerMsgCmd .at (NET_MESSAGE_COMMAND_OTHER ) += msg.m_raw_message_size ;
656
+ mapRecvBytesPerMsgType .at (NET_MESSAGE_TYPE_OTHER ) += msg.m_raw_message_size ;
657
657
continue ;
658
658
}
659
659
660
660
// Store received bytes per message command
661
661
// to prevent a memory DOS, only allow valid commands
662
- auto i = mapRecvBytesPerMsgCmd .find (msg.m_type );
663
- if (i == mapRecvBytesPerMsgCmd .end ()) {
664
- i = mapRecvBytesPerMsgCmd .find (NET_MESSAGE_COMMAND_OTHER );
662
+ auto i = mapRecvBytesPerMsgType .find (msg.m_type );
663
+ if (i == mapRecvBytesPerMsgType .end ()) {
664
+ i = mapRecvBytesPerMsgType .find (NET_MESSAGE_TYPE_OTHER );
665
665
}
666
- assert (i != mapRecvBytesPerMsgCmd .end ());
666
+ assert (i != mapRecvBytesPerMsgType .end ());
667
667
i->second += msg.m_raw_message_size ;
668
668
669
669
// push the message to the process queue,
@@ -2983,8 +2983,8 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, SOCKET hSocketIn, const
2983
2983
}
2984
2984
2985
2985
for (const std::string &msg : getAllNetMessageTypes ())
2986
- mapRecvBytesPerMsgCmd [msg] = 0 ;
2987
- mapRecvBytesPerMsgCmd[NET_MESSAGE_COMMAND_OTHER ] = 0 ;
2986
+ mapRecvBytesPerMsgType [msg] = 0 ;
2987
+ mapRecvBytesPerMsgType[NET_MESSAGE_TYPE_OTHER ] = 0 ;
2988
2988
2989
2989
if (fLogIPs ) {
2990
2990
LogPrint (BCLog::NET, " Added connection to %s peer=%d\n " , m_addr_name, id);
@@ -3034,7 +3034,7 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)
3034
3034
bool optimisticSend (pnode->vSendMsg .empty ());
3035
3035
3036
3036
// log total amount of bytes per message type
3037
- pnode->mapSendBytesPerMsgCmd [msg.m_type ] += nTotalSize;
3037
+ pnode->mapSendBytesPerMsgType [msg.m_type ] += nTotalSize;
3038
3038
pnode->nSendSize += nTotalSize;
3039
3039
3040
3040
if (pnode->nSendSize > nSendBufferMaxSize) pnode->fPauseSend = true ;
0 commit comments