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

Method RemoveTransaction

src/txgraph.cpp:2262–2279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2260}
2261
2262void TxGraphImpl::RemoveTransaction(const Ref& arg) noexcept
2263{
2264 // Don't do anything if the Ref is empty (which may be indicative of the transaction already
2265 // having been removed).
2266 if (GetRefGraph(arg) == nullptr) return;
2267 Assume(GetRefGraph(arg) == this);
2268 Assume(m_main_chunkindex_observers == 0 || GetTopLevel() != 0);
2269 // Find the Cluster the transaction is in, and stop if it isn't in any.
2270 int level = GetTopLevel();
2271 auto cluster = FindCluster(GetRefIndex(arg), level);
2272 if (cluster == nullptr) return;
2273 // Remember that the transaction is to be removed.
2274 auto& clusterset = GetClusterSet(level);
2275 clusterset.m_to_remove.push_back(GetRefIndex(arg));
2276 // Wipe m_group_data (as it will need to be recomputed).
2277 clusterset.m_group_data.reset();
2278 if (clusterset.m_oversized == true) clusterset.m_oversized = std::nullopt;
2279}
2280
2281void TxGraphImpl::AddDependency(const Ref& parent, const Ref& child) noexcept
2282{

Callers 1

StageRemovalMethod · 0.45

Calls 2

push_backMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected