| 156 | void CNode::Cleanup() {} |
| 157 | |
| 158 | void CNode::PushVersion() { |
| 159 | int32_t nBestHeight = GetNodeSignals().GetHeight().get_value_or(0); |
| 160 | |
| 161 | #ifdef WIN32 |
| 162 | string os("windows"); |
| 163 | #else |
| 164 | string os("linux"); |
| 165 | #endif |
| 166 | vector<string> comments; |
| 167 | comments.push_back(os); |
| 168 | /// when NTP implemented, change to just nTime = GetAdjustedTime() |
| 169 | int64_t nTime = (fInbound ? GetAdjustedTime() : GetTime()); |
| 170 | CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService("0.0.0.0", 0))); |
| 171 | CAddress addrMe = GetLocalAddress(&addr); |
| 172 | RAND_bytes((uint8_t*)&nLocalHostNonce, sizeof(nLocalHostNonce)); |
| 173 | LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%s\n", PROTOCOL_VERSION, |
| 174 | nBestHeight, addrMe.ToString(), addrYou.ToString(), addr.ToString()); |
| 175 | |
| 176 | PushMessage(NetMsgType::VERSION, PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe, nLocalHostNonce, |
| 177 | FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, comments), nBestHeight, true); |
| 178 | } |
| 179 | |
| 180 | map<CNetAddr, int64_t> CNode::setBanned; |
| 181 | CCriticalSection CNode::cs_setBanned; |
no test coverage detected