@@ -651,14 +651,14 @@ bool CNode::ReceiveMsgBytes(Span<const uint8_t> msg_bytes, bool& complete)
651651 bool reject_message{false };
652652 CNetMessage msg = m_deserializer->GetMessage (time, reject_message);
653653 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.
655655 // store the size of the corrupt message
656656 mapRecvBytesPerMsgType.at (NET_MESSAGE_TYPE_OTHER) += msg.m_raw_message_size ;
657657 continue ;
658658 }
659659
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.
662662 auto i = mapRecvBytesPerMsgType.find (msg.m_type );
663663 if (i == mapRecvBytesPerMsgType.end ()) {
664664 i = mapRecvBytesPerMsgType.find (NET_MESSAGE_TYPE_OTHER);
@@ -748,7 +748,7 @@ CNetMessage V1TransportDeserializer::GetMessage(const std::chrono::microseconds
748748 // decompose a single CNetMessage from the TransportDeserializer
749749 CNetMessage msg (std::move (vRecv));
750750
751- // store command string, time, and sizes
751+ // store message type string, time, and sizes
752752 msg.m_type = hdr.GetCommand ();
753753 msg.m_time = time;
754754 msg.m_message_size = hdr.nMessageSize ;
@@ -759,7 +759,7 @@ CNetMessage V1TransportDeserializer::GetMessage(const std::chrono::microseconds
759759 // We just received a message off the wire, harvest entropy from the time (and the message checksum)
760760 RandAddEvent (ReadLE32 (hash.begin ()));
761761
762- // Check checksum and header command string
762+ // Check checksum and header message type string
763763 if (memcmp (hash.begin (), hdr.pchChecksum , CMessageHeader::CHECKSUM_SIZE) != 0 ) {
764764 LogPrint (BCLog::NET, " Header error: Wrong checksum (%s, %u bytes), expected %s was %s, peer=%d\n " ,
765765 SanitizeString (msg.m_type ), msg.m_message_size ,
0 commit comments