Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 1,031 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
bool CCoinsViewMemPool::HaveCoin(const COutPoint &outpoint) const { | bool CCoinsViewMemPool::HaveCoin(const COutPoint &outpoint) const { | ||||
return mempool.exists(outpoint) || base->HaveCoin(outpoint); | return mempool.exists(outpoint) || base->HaveCoin(outpoint); | ||||
} | } | ||||
size_t CTxMemPool::DynamicMemoryUsage() const { | size_t CTxMemPool::DynamicMemoryUsage() const { | ||||
LOCK(cs); | LOCK(cs); | ||||
// Estimate the overhead of mapTx to be 15 pointers + an allocation, as no | // Estimate the overhead of mapTx to be 12 pointers + an allocation, as no | ||||
// exact formula for boost::multi_index_contained is implemented. | // exact formula for boost::multi_index_contained is implemented. | ||||
return memusage::MallocUsage(sizeof(CTxMemPoolEntry) + | return memusage::MallocUsage(sizeof(CTxMemPoolEntry) + | ||||
15 * sizeof(void *)) * | 12 * sizeof(void *)) * | ||||
mapTx.size() + | mapTx.size() + | ||||
memusage::DynamicUsage(mapNextTx) + | memusage::DynamicUsage(mapNextTx) + | ||||
memusage::DynamicUsage(mapDeltas) + | memusage::DynamicUsage(mapDeltas) + | ||||
memusage::DynamicUsage(mapLinks) + | memusage::DynamicUsage(mapLinks) + | ||||
memusage::DynamicUsage(vTxHashes) + cachedInnerUsage; | memusage::DynamicUsage(vTxHashes) + cachedInnerUsage; | ||||
} | } | ||||
void CTxMemPool::RemoveStaged(setEntries &stage, bool updateDescendants, | void CTxMemPool::RemoveStaged(setEntries &stage, bool updateDescendants, | ||||
▲ Show 20 Lines • Show All 354 Lines • Show Last 20 Lines |