MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / PushNodeVersion

Function PushNodeVersion

src/net_processing.cpp:323–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323static 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

Callers 2

InitializeNodeMethod · 0.85
ProcessMessageFunction · 0.85

Calls 12

IsProxyFunction · 0.85
CNetMsgMakerClass · 0.85
GetLocalNonceMethod · 0.80
GetMyStartingHeightMethod · 0.80
GetIdMethod · 0.80
IsRoutableMethod · 0.80
PushMessageMethod · 0.80
MakeMethod · 0.80
CAddressClass · 0.70
CServiceClass · 0.70
GetLocalServicesMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected