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

Method Delete

src/addrman.cpp:437–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437void AddrManImpl::Delete(nid_type nId)
438{
439 AssertLockHeld(cs);
440
441 assert(mapInfo.contains(nId));
442 AddrInfo& info = mapInfo[nId];
443 assert(!info.fInTried);
444 assert(info.nRefCount == 0);
445
446 SwapRandom(info.nRandomPos, vRandom.size() - 1);
447 m_network_counts[info.GetNetwork()].n_new--;
448 vRandom.pop_back();
449 mapAddr.erase(info);
450 mapInfo.erase(nId);
451 nNew--;
452}
453
454void AddrManImpl::ClearNew(int nUBucket, int nUBucketPos)
455{

Callers 1

EraseImplMethod · 0.45

Calls 5

GetNetworkMethod · 0.80
containsMethod · 0.45
sizeMethod · 0.45
pop_backMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected