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

Method RemoveTransactions

src/cluster_linearize.h:160–174  ·  view source on GitHub ↗

Remove the specified positions from this DepGraph. * * The specified positions will no longer be part of Positions(), and dependencies with them are * removed. Note that due to DepGraph only tracking ancestors/descendants (and not direct * dependencies), if a parent is removed while a grandparent remains, the grandparent will * remain an ancestor. * * Complexity:

Source from the content-addressed store, hash-verified

158 * Complexity: O(N) where N=TxCount().
159 */
160 void RemoveTransactions(const SetType& del) noexcept
161 {
162 m_used -= del;
163 // Remove now-unused trailing entries.
164 while (!entries.empty() && !m_used[entries.size() - 1]) {
165 entries.pop_back();
166 }
167 // Remove the deleted transactions from ancestors/descendants of other transactions. Note
168 // that the deleted positions will retain old feerate and dependency information. This does
169 // not matter as they will be overwritten by AddTransaction if they get used again.
170 for (auto& entry : entries) {
171 entry.ancestors &= m_used;
172 entry.descendants &= m_used;
173 }
174 }
175
176 /** Modify this transaction graph, adding multiple parents to a specified child.
177 *

Callers 6

ApplyRemovalsMethod · 0.80
RemoveTransactionMethod · 0.80
DestroyTransactionMethod · 0.80
BuildTreeGraphFunction · 0.80
FUZZ_TARGETFunction · 0.80

Calls 3

emptyMethod · 0.45
sizeMethod · 0.45
pop_backMethod · 0.45

Tested by 5

RemoveTransactionMethod · 0.64
DestroyTransactionMethod · 0.64
BuildTreeGraphFunction · 0.64
FUZZ_TARGETFunction · 0.64