Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 604 Lines • ▼ Show 20 Lines | void removeRecursive( | ||||
const CTransaction &tx, | const CTransaction &tx, | ||||
MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN); | MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN); | ||||
void removeForReorg(const Config &config, const CCoinsViewCache *pcoins, | void removeForReorg(const Config &config, const CCoinsViewCache *pcoins, | ||||
unsigned int nMemPoolHeight, int flags); | unsigned int nMemPoolHeight, int flags); | ||||
void removeConflicts(const CTransaction &tx); | void removeConflicts(const CTransaction &tx); | ||||
void removeForBlock(const std::vector<CTransactionRef> &vtx, | void removeForBlock(const std::vector<CTransactionRef> &vtx, | ||||
unsigned int nBlockHeight); | unsigned int nBlockHeight); | ||||
// clear but then return a vector of all transactions | |||||
std::vector<CTransactionRef> takeAll(); | |||||
void clear(); | void clear(); | ||||
// lock free | // lock free | ||||
void _clear(); | void _clear(); | ||||
bool CompareDepthAndScore(const uint256 &hasha, const uint256 &hashb); | bool CompareDepthAndScore(const uint256 &hasha, const uint256 &hashb); | ||||
void queryHashes(std::vector<uint256> &vtxid); | void queryHashes(std::vector<uint256> &vtxid); | ||||
bool isSpent(const COutPoint &outpoint); | bool isSpent(const COutPoint &outpoint); | ||||
unsigned int GetTransactionsUpdated() const; | unsigned int GetTransactionsUpdated() const; | ||||
void AddTransactionsUpdated(unsigned int n); | void AddTransactionsUpdated(unsigned int n); | ||||
▲ Show 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | public: | ||||
// Remove an entry by insertion_order index, and update memory usage. | // Remove an entry by insertion_order index, and update memory usage. | ||||
void removeEntry(indexed_disconnected_transactions::index< | void removeEntry(indexed_disconnected_transactions::index< | ||||
insertion_order>::type::iterator entry) { | insertion_order>::type::iterator entry) { | ||||
cachedInnerUsage -= RecursiveDynamicUsage(*entry); | cachedInnerUsage -= RecursiveDynamicUsage(*entry); | ||||
queuedTx.get<insertion_order>().erase(entry); | queuedTx.get<insertion_order>().erase(entry); | ||||
} | } | ||||
bool isEmpty() { return queuedTx.empty(); } | |||||
void clear() { | void clear() { | ||||
cachedInnerUsage = 0; | cachedInnerUsage = 0; | ||||
queuedTx.clear(); | queuedTx.clear(); | ||||
} | } | ||||
/** | /** | ||||
* Make mempool consistent after a reorg, by re-adding or recursively | * Make mempool consistent after a reorg, by re-adding or recursively | ||||
* erasing disconnected block transactions from the mempool, and also | * erasing disconnected block transactions from the mempool, and also | ||||
Show All 14 Lines |