Use
SanitizeStringwhen logging message errors to make sure that the message type is sanitized. I have checked all logging innet.cpp.For the
MESSAGESTARTerror don't inspect and log header details at all: receiving invalid start bytes makes it likely that the packet isn't even formatted as valid P2P message. Logging the four unexpected start bytes (as hex) should be enough.Update
p2p_invalid_messages.pytest to check this.Improve error messages in a second commit.
Issue reported by gmaxwell.