MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / Create

Method Create

src/addrman.cpp:397–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397AddrInfo* AddrManImpl::Create(const CAddress& addr, const CNetAddr& addrSource, nid_type* pnId)
398{
399 AssertLockHeld(cs);
400
401 nid_type nId = nIdCount++;
402 mapInfo[nId] = AddrInfo(addr, addrSource);
403 mapAddr[addr] = nId;
404 mapInfo[nId].nRandomPos = vRandom.size();
405 vRandom.push_back(nId);
406 nNew++;
407 m_network_counts[addr.GetNetwork()].n_new++;
408 if (pnId)
409 *pnId = nId;
410 return &mapInfo[nId];
411}
412
413void AddrManImpl::SwapRandom(unsigned int nRndPos1, unsigned int nRndPos2) const
414{

Callers

nothing calls this directly

Calls 4

GetNetworkMethod · 0.80
AddrInfoClass · 0.70
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected