Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 1,350 Lines • ▼ Show 20 Lines | void DisconnectedBlockTransactions::updateMempoolForReorg(const Config &config, | ||||
// Iterate disconnectpool in reverse, so that we add transactions back to | // Iterate disconnectpool in reverse, so that we add transactions back to | ||||
// the mempool starting with the earliest transaction that had been | // the mempool starting with the earliest transaction that had been | ||||
// previously seen in a block. | // previously seen in a block. | ||||
for (const CTransactionRef &tx : | for (const CTransactionRef &tx : | ||||
reverse_iterate(queuedTx.get<insertion_order>())) { | reverse_iterate(queuedTx.get<insertion_order>())) { | ||||
// ignore validation errors in resurrected transactions | // ignore validation errors in resurrected transactions | ||||
CValidationState stateDummy; | CValidationState stateDummy; | ||||
if (!fAddToMempool || tx->IsCoinBase() || | if (!fAddToMempool || tx->IsCoinBase() || | ||||
!AcceptToMemoryPool(config, g_mempool, stateDummy, tx, false, | !AcceptToMemoryPool(config, g_mempool, stateDummy, tx, nullptr, | ||||
nullptr, true)) { | true, Amount::zero())) { | ||||
// If the transaction doesn't make it in to the mempool, remove any | // If the transaction doesn't make it in to the mempool, remove any | ||||
// transactions that depend on it (which would now be orphans). | // transactions that depend on it (which would now be orphans). | ||||
g_mempool.removeRecursive(*tx, MemPoolRemovalReason::REORG); | g_mempool.removeRecursive(*tx, MemPoolRemovalReason::REORG); | ||||
} else if (g_mempool.exists(tx->GetId())) { | } else if (g_mempool.exists(tx->GetId())) { | ||||
txidsUpdate.push_back(tx->GetId()); | txidsUpdate.push_back(tx->GetId()); | ||||
} | } | ||||
} | } | ||||
Show All 19 Lines |