| 204 | } |
| 205 | |
| 206 | void 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 | |
| 229 | void CTxMemPool::addNewTransaction(CTxMemPool::txiter newit) |
| 230 | { |
no test coverage detected