MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / ProcessRejectMessage

Function ProcessRejectMessage

src/p2p/chainmessage.cpp:897–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

895 return true;
896}
897void ProcessRejectMessage(CNode *pFrom, CDataStream &vRecv) {
898 if (SysCfg().IsDebug()) {
899 string message;
900 uint8_t code;
901 string strReason;
902 vRecv >> message >> code >> strReason;
903
904 ostringstream ss;
905 ss << message << " code " << itostr(code) << ": " << strReason;
906
907 if (message == "block" || message == "tx") {
908 uint256 hash;
909 vRecv >> hash;
910 ss << ": hash " << hash.ToString();
911 }
912 // Truncate to reasonable length and sanitize before printing:
913 string s = ss.str();
914 if (s.size() > 111)
915 s.erase(111, string::npos);
916
917 LogPrint(BCLog::NET, "Reject %s from peer %s\n", SanitizeString(s), pFrom->addr.ToString());
918 }
919}
920

Callers 1

ProcessMessageFunction · 0.85

Calls 7

itostrFunction · 0.85
IsDebugMethod · 0.80
strMethod · 0.80
SanitizeStringFunction · 0.50
ToStringMethod · 0.45
sizeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected