MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / IsMessageTypeValid

Method IsMessageTypeValid

src/protocol.cpp:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26bool CMessageHeader::IsMessageTypeValid() const
27{
28 // Check the message type string for errors
29 for (const char* p1 = m_msg_type; p1 < m_msg_type + MESSAGE_TYPE_SIZE; ++p1) {
30 if (*p1 == 0) {
31 // Must be all zeros after the first zero
32 for (; p1 < m_msg_type + MESSAGE_TYPE_SIZE; ++p1) {
33 if (*p1 != 0) {
34 return false;
35 }
36 }
37 } else if (*p1 < ' ' || *p1 > 0x7E) {
38 return false;
39 }
40 }
41
42 return true;
43}
44
45CInv::CInv()
46{

Callers 2

GetReceivedMessageMethod · 0.80
deserialize.cppFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected