MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / PushAddress

Method PushAddress

src/net.h:416–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414 }
415
416 void PushAddress(const CAddress& addr)
417 {
418 // Known checking here is only to save space from duplicates.
419 // SendMessages will filter it again for knowns that were added
420 // after addresses were pushed.
421 if (addr.IsValid() && !addrKnown.contains(addr.GetKey())) {
422 if (vAddrToSend.size() >= MAX_ADDR_TO_SEND) {
423 vAddrToSend[insecure_rand() % vAddrToSend.size()] = addr;
424 } else {
425 vAddrToSend.push_back(addr);
426 }
427 }
428 }
429
430
431 bool AddInventoryKnown(const CInv& inv)

Callers 3

ProcessMessageFunction · 0.80
BOOST_FOREACHFunction · 0.80
AdvertizeLocalFunction · 0.80

Calls 6

insecure_randFunction · 0.85
IsValidMethod · 0.45
containsMethod · 0.45
GetKeyMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected