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

Method ClearLocator

src/txgraph.cpp:1030–1055  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1028}
1029
1030void TxGraphImpl::ClearLocator(int level, GraphIndex idx, bool oversized_tx) noexcept
1031{
1032 auto& entry = m_entries[idx];
1033 auto& clusterset = GetClusterSet(level);
1034 Assume(entry.m_locator[level].IsPresent());
1035 // Change the locator from Present to Missing or Removed.
1036 if (level == 0 || !entry.m_locator[level - 1].IsPresent()) {
1037 entry.m_locator[level].SetMissing();
1038 } else {
1039 entry.m_locator[level].SetRemoved();
1040 clusterset.m_removed.push_back(idx);
1041 }
1042 // Update the transaction count.
1043 --clusterset.m_txcount;
1044 clusterset.m_txcount_oversized -= oversized_tx;
1045 // If clearing main, adjust the status of Locators of this transaction in staging, if it exists.
1046 if (level == 0 && GetTopLevel() == 1) {
1047 if (entry.m_locator[1].IsRemoved()) {
1048 entry.m_locator[1].SetMissing();
1049 } else if (!entry.m_locator[1].IsPresent()) {
1050 --m_staging_clusterset->m_txcount;
1051 m_staging_clusterset->m_txcount_oversized -= oversized_tx;
1052 }
1053 }
1054 if (level == 0) ClearChunkData(entry);
1055}
1056
1057void GenericClusterImpl::RemoveChunkData(TxGraphImpl& graph) noexcept
1058{

Callers 2

ApplyRemovalsMethod · 0.80
ClearMethod · 0.80

Calls 5

IsPresentMethod · 0.80
SetMissingMethod · 0.80
SetRemovedMethod · 0.80
IsRemovedMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected