mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01: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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user