@@ -651,14 +651,14 @@ bool CNode::ReceiveMsgBytes(Span<const uint8_t> msg_bytes, bool& complete)
651
651
bool reject_message{false };
652
652
CNetMessage msg = m_deserializer->GetMessage (time, reject_message);
653
653
if (reject_message) {
654
- // Message deserialization failed. Drop the message but don't disconnect the peer.
654
+ // Message deserialization failed. Drop the message but don't disconnect the peer.
655
655
// store the size of the corrupt message
656
656
mapRecvBytesPerMsgType.at (NET_MESSAGE_TYPE_OTHER) += msg.m_raw_message_size ;
657
657
continue ;
658
658
}
659
659
660
- // Store received bytes per message command
661
- // to prevent a memory DOS, only allow valid commands
660
+ // Store received bytes per message type.
661
+ // To prevent a memory DOS, only allow known message types.
662
662
auto i = mapRecvBytesPerMsgType.find (msg.m_type );
663
663
if (i == mapRecvBytesPerMsgType.end ()) {
664
664
i = mapRecvBytesPerMsgType.find (NET_MESSAGE_TYPE_OTHER);
@@ -748,7 +748,7 @@ CNetMessage V1TransportDeserializer::GetMessage(const std::chrono::microseconds
748
748
// decompose a single CNetMessage from the TransportDeserializer
749
749
CNetMessage msg (std::move (vRecv));
750
750
751
- // store command string, time, and sizes
751
+ // store message type string, time, and sizes
752
752
msg.m_type = hdr.GetCommand ();
753
753
msg.m_time = time;
754
754
msg.m_message_size = hdr.nMessageSize ;
@@ -759,7 +759,7 @@ CNetMessage V1TransportDeserializer::GetMessage(const std::chrono::microseconds
759
759
// We just received a message off the wire, harvest entropy from the time (and the message checksum)
760
760
RandAddEvent (ReadLE32 (hash.begin ()));
761
761
762
- // Check checksum and header command string
762
+ // Check checksum and header message type string
763
763
if (memcmp (hash.begin (), hdr.pchChecksum , CMessageHeader::CHECKSUM_SIZE) != 0 ) {
764
764
LogPrint (BCLog::NET, " Header error: Wrong checksum (%s, %u bytes), expected %s was %s, peer=%d\n " ,
765
765
SanitizeString (msg.m_type ), msg.m_message_size ,
0 commit comments