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

Method Apply

src/txmempool.cpp:206–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206void CTxMemPool::Apply(ChangeSet* changeset)
207{
208 AssertLockHeld(cs);
209 m_txgraph->CommitStaging();
210
211 RemoveStaged(changeset->m_to_remove, MemPoolRemovalReason::REPLACED);
212
213 for (size_t i=0; i<changeset->m_entry_vec.size(); ++i) {
214 auto tx_entry = changeset->m_entry_vec[i];
215 // First splice this entry into mapTx.
216 auto node_handle = changeset->m_to_add.extract(tx_entry);
217 auto result = mapTx.insert(std::move(node_handle));
218
219 Assume(result.inserted);
220 txiter it = result.position;
221
222 addNewTransaction(it);
223 }
224 if (!m_txgraph->DoWork(/*max_cost=*/POST_CHANGE_COST)) {
225 LogDebug(BCLog::MEMPOOL, "Mempool in non-optimal ordering after addition(s).");
226 }
227}
228
229void CTxMemPool::addNewTransaction(CTxMemPool::txiter newit)
230{

Callers 2

FinalizeSubpackageMethod · 0.45
SubmitPackageMethod · 0.45

Calls 5

CommitStagingMethod · 0.80
DoWorkMethod · 0.80
sizeMethod · 0.45
insertMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected