Changeset View
Changeset View
Standalone View
Standalone View
src/test/mempool_tests.cpp
Show First 20 Lines • Show All 876 Lines • ▼ Show 20 Lines | for (auto &disconnectedTxns : | ||||
for (auto &unconfTxns : {unconfTxnsInOrder, unconfTxnsOutOfOrder}) { | for (auto &unconfTxns : {unconfTxnsInOrder, unconfTxnsOutOfOrder}) { | ||||
// addForBlock inserts disconnectTxns in disconnectPool. They | // addForBlock inserts disconnectTxns in disconnectPool. They | ||||
// simulate transactions that were once confirmed in a block | // simulate transactions that were once confirmed in a block | ||||
std::vector<CTransactionRef> vtx; | std::vector<CTransactionRef> vtx; | ||||
for (auto tx : disconnectedTxns) { | for (auto tx : disconnectedTxns) { | ||||
vtx.push_back(MakeTransactionRef(*tx)); | vtx.push_back(MakeTransactionRef(*tx)); | ||||
} | } | ||||
DisconnectedBlockTransactions disconnectPool; | DisconnectedBlockTransactions disconnectPool; | ||||
{ | |||||
LOCK(::g_mempool.cs); | |||||
disconnectPool.addForBlock(vtx); | disconnectPool.addForBlock(vtx); | ||||
} | |||||
CheckDisconnectPoolOrder(disconnectPool, correctlyOrderedIds, | CheckDisconnectPoolOrder(disconnectPool, correctlyOrderedIds, | ||||
disconnectedTxns.size()); | disconnectedTxns.size()); | ||||
// If the mempool is empty, importMempool doesn't change | // If the mempool is empty, importMempool doesn't change | ||||
// disconnectPool | // disconnectPool | ||||
CTxMemPool testPool; | CTxMemPool testPool; | ||||
disconnectPool.importMempool(testPool); | disconnectPool.importMempool(testPool); | ||||
▲ Show 20 Lines • Show All 252 Lines • Show Last 20 Lines |