Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 919 Lines • ▼ Show 20 Lines | public: | ||||
// Import mempool entries in topological order into queuedTx and clear the | // Import mempool entries in topological order into queuedTx and clear the | ||||
// mempool. Caller should call updateMempoolForReorg to reprocess these | // mempool. Caller should call updateMempoolForReorg to reprocess these | ||||
// transactions | // transactions | ||||
void importMempool(CTxMemPool &pool); | void importMempool(CTxMemPool &pool); | ||||
// Add entries for a block while reconstructing the topological ordering so | // Add entries for a block while reconstructing the topological ordering so | ||||
// they can be added back to the mempool simply. | // they can be added back to the mempool simply. | ||||
void addForBlock(const std::vector<CTransactionRef> &vtx); | void addForBlock(const std::vector<CTransactionRef> &vtx, CTxMemPool &pool); | ||||
// Remove entries based on txid_index, and update memory usage. | // Remove entries based on txid_index, and update memory usage. | ||||
void removeForBlock(const std::vector<CTransactionRef> &vtx) { | void removeForBlock(const std::vector<CTransactionRef> &vtx) { | ||||
// Short-circuit in the common case of a block being added to the tip | // Short-circuit in the common case of a block being added to the tip | ||||
if (queuedTx.empty()) { | if (queuedTx.empty()) { | ||||
return; | return; | ||||
} | } | ||||
for (auto const &tx : vtx) { | for (auto const &tx : vtx) { | ||||
Show All 27 Lines | public: | ||||
* | * | ||||
* Note: we assume that disconnectpool only contains transactions that are | * Note: we assume that disconnectpool only contains transactions that are | ||||
* NOT confirmed in the current chain nor already in the mempool (otherwise, | * NOT confirmed in the current chain nor already in the mempool (otherwise, | ||||
* in-mempool descendants of such transactions would be removed). | * in-mempool descendants of such transactions would be removed). | ||||
* | * | ||||
* Passing fAddToMempool=false will skip trying to add the transactions | * Passing fAddToMempool=false will skip trying to add the transactions | ||||
* back, and instead just erase from the mempool as needed. | * back, and instead just erase from the mempool as needed. | ||||
*/ | */ | ||||
void updateMempoolForReorg(const Config &config, bool fAddToMempool); | void updateMempoolForReorg(const Config &config, bool fAddToMempool, | ||||
CTxMemPool &pool); | |||||
}; | }; | ||||
#endif // BITCOIN_TXMEMPOOL_H | #endif // BITCOIN_TXMEMPOOL_H |