| 321 | } |
| 322 | |
| 323 | static void PushNodeVersion(CNode *pnode, CConnman* connman, int64_t nTime) |
| 324 | { |
| 325 | ServiceFlags nLocalNodeServices = pnode->GetLocalServices(); |
| 326 | uint64_t nonce = pnode->GetLocalNonce(); |
| 327 | int nNodeStartingHeight = pnode->GetMyStartingHeight(); |
| 328 | NodeId nodeid = pnode->GetId(); |
| 329 | CAddress addr = pnode->addr; |
| 330 | |
| 331 | CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService(), addr.nServices)); |
| 332 | CAddress addrMe = CAddress(CService(), nLocalNodeServices); |
| 333 | |
| 334 | connman->PushMessage(pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::VERSION, PROTOCOL_VERSION, (uint64_t)nLocalNodeServices, nTime, addrYou, addrMe, |
| 335 | nonce, strSubVersion, nNodeStartingHeight, ::fRelayTxes)); |
| 336 | |
| 337 | if (fLogIPs) { |
| 338 | LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), addrYou.ToString(), nodeid); |
| 339 | } else { |
| 340 | LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), nodeid); |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | // Returns a bool indicating whether we requested this block. |
| 345 | // Also used if a block was /not/ received and timed out or started with another peer |
no test coverage detected