mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-31 08:13:52 +02:00
make DisconnectedBlockTransactions responsible for its own memory management
Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
This commit is contained in:
@@ -73,9 +73,10 @@ static ReorgTxns CreateBlocks(size_t num_not_shared)
|
||||
|
||||
static void Reorg(const ReorgTxns& reorg)
|
||||
{
|
||||
DisconnectedBlockTransactions disconnectpool;
|
||||
DisconnectedBlockTransactions disconnectpool{MAX_DISCONNECTED_TX_POOL_SIZE * 1000};
|
||||
// Disconnect block
|
||||
disconnectpool.AddTransactionsFromBlock(reorg.disconnected_txns);
|
||||
const auto evicted = disconnectpool.AddTransactionsFromBlock(reorg.disconnected_txns);
|
||||
assert(evicted.empty());
|
||||
|
||||
// Connect first block
|
||||
disconnectpool.removeForBlock(reorg.connected_txns_1);
|
||||
|
||||
Reference in New Issue
Block a user