mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
[refactor] batch-add transactions to DisconnectedBlockTransactions
No behavior change. In a future commit, we can optimize by reserving vtx.size().
This commit is contained in:
parent
5666966dff
commit
925bb723ca
2 changed files with 12 additions and 6 deletions
|
|
@ -2721,9 +2721,7 @@ bool Chainstate::DisconnectTip(BlockValidationState& state, DisconnectedBlockTra
|
|||
|
||||
if (disconnectpool && m_mempool) {
|
||||
// Save transactions to re-add to mempool at end of reorg
|
||||
for (auto it = block.vtx.rbegin(); it != block.vtx.rend(); ++it) {
|
||||
disconnectpool->addTransaction(*it);
|
||||
}
|
||||
disconnectpool->AddTransactionsFromBlock(block.vtx);
|
||||
while (disconnectpool->DynamicMemoryUsage() > MAX_DISCONNECTED_TX_POOL_SIZE * 1000) {
|
||||
// Drop the earliest entry, and remove its children from the mempool.
|
||||
auto it = disconnectpool->queuedTx.get<insertion_order>().begin();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue