| 517 | } |
| 518 | |
| 519 | void CNode::PushVersion() |
| 520 | { |
| 521 | int nBestHeight = g_signals.GetHeight().get_value_or(0); |
| 522 | |
| 523 | /// when NTP implemented, change to just nTime = GetAdjustedTime() |
| 524 | int64_t nTime = (fInbound ? GetAdjustedTime() : GetTime()); |
| 525 | CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService("0.0.0.0"), NODE_NONE)); |
| 526 | CAddress addrMe = GetLocalAddress(&addr); |
| 527 | GetRandBytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce)); |
| 528 | if (fLogIPs) |
| 529 | LogPrint("net", "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), addrYou.ToString(), id); |
| 530 | else |
| 531 | LogPrint("net", "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), id); |
| 532 | PushMessage("version", PROTOCOL_VERSION, (uint64_t) nLocalServices, nTime, addrYou, addrMe, |
| 533 | nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector<string>()), nBestHeight, true); |
| 534 | } |
| 535 | |
| 536 | |
| 537 | banmap_t CNode::setBanned; |
no test coverage detected