MCPcopy Create free account
hub / github.com/ElementsProject/elements / IsCommandValid

Method IsCommandValid

src/protocol.cpp:107–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107bool CMessageHeader::IsCommandValid() const
108{
109 // Check the command string for errors
110 for (const char* p1 = pchCommand; p1 < pchCommand + COMMAND_SIZE; ++p1) {
111 if (*p1 == 0) {
112 // Must be all zeros after the first zero
113 for (; p1 < pchCommand + COMMAND_SIZE; ++p1) {
114 if (*p1 != 0) {
115 return false;
116 }
117 }
118 } else if (*p1 < ' ' || *p1 > 0x7E) {
119 return false;
120 }
121 }
122
123 return true;
124}
125
126
127ServiceFlags GetDesirableServiceFlags(ServiceFlags services) {

Callers 2

GetMessageMethod · 0.80
deserialize.cppFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected