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

Method MoveToMain

src/txgraph.cpp:1341–1356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1339}
1340
1341void GenericClusterImpl::MoveToMain(TxGraphImpl& graph) noexcept
1342{
1343 for (auto i : m_linearization) {
1344 GraphIndex idx = m_mapping[i];
1345 auto& entry = graph.m_entries[idx];
1346 entry.m_locator[1].SetMissing();
1347 }
1348 auto quality = m_quality;
1349 // Subtract memory usage from staging and add it to main.
1350 graph.GetClusterSet(/*level=*/1).m_cluster_usage -= TotalMemoryUsage();
1351 graph.GetClusterSet(/*level=*/0).m_cluster_usage += TotalMemoryUsage();
1352 // Remove cluster itself from staging and add it to main.
1353 auto cluster = graph.ExtractCluster(1, quality, m_setindex);
1354 graph.InsertCluster(/*level=*/0, std::move(cluster), quality);
1355 Updated(graph, /*level=*/0, /*rename=*/false);
1356}
1357
1358void SingletonClusterImpl::MoveToMain(TxGraphImpl& graph) noexcept
1359{

Callers 1

CommitStagingMethod · 0.80

Calls 3

SetMissingMethod · 0.80
ExtractClusterMethod · 0.80
InsertClusterMethod · 0.80

Tested by

no test coverage detected