| 895 | return true; |
| 896 | } |
| 897 | void 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 |
no test coverage detected