Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 424 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void CTxMemPool::AddTransactionsUpdated(unsigned int n) { | void CTxMemPool::AddTransactionsUpdated(unsigned int n) { | ||||
LOCK(cs); | LOCK(cs); | ||||
nTransactionsUpdated += n; | nTransactionsUpdated += n; | ||||
} | } | ||||
bool CTxMemPool::addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, | bool CTxMemPool::addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, | ||||
setEntries &setAncestors, bool validFeeEstimate) { | setEntries &setAncestors) { | ||||
NotifyEntryAdded(entry.GetSharedTx()); | NotifyEntryAdded(entry.GetSharedTx()); | ||||
// Add to memory pool without checking anything. | // Add to memory pool without checking anything. | ||||
// Used by AcceptToMemoryPool(), which DOES do all the appropriate checks. | // Used by AcceptToMemoryPool(), which DOES do all the appropriate checks. | ||||
LOCK(cs); | LOCK(cs); | ||||
indexed_transaction_set::iterator newit = mapTx.insert(entry).first; | indexed_transaction_set::iterator newit = mapTx.insert(entry).first; | ||||
mapLinks.insert(make_pair(newit, TxLinks())); | mapLinks.insert(make_pair(newit, TxLinks())); | ||||
// Update transaction for any feeDelta created by PrioritiseTransaction | // Update transaction for any feeDelta created by PrioritiseTransaction | ||||
▲ Show 20 Lines • Show All 660 Lines • ▼ Show 20 Lines | void CTxMemPool::LimitSize(size_t limit, unsigned long age) { | ||||
std::vector<COutPoint> vNoSpendsRemaining; | std::vector<COutPoint> vNoSpendsRemaining; | ||||
TrimToSize(limit, &vNoSpendsRemaining); | TrimToSize(limit, &vNoSpendsRemaining); | ||||
for (const COutPoint &removed : vNoSpendsRemaining) { | for (const COutPoint &removed : vNoSpendsRemaining) { | ||||
pcoinsTip->Uncache(removed); | pcoinsTip->Uncache(removed); | ||||
} | } | ||||
} | } | ||||
bool CTxMemPool::addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, | bool CTxMemPool::addUnchecked(const uint256 &hash, | ||||
bool validFeeEstimate) { | const CTxMemPoolEntry &entry) { | ||||
LOCK(cs); | LOCK(cs); | ||||
setEntries setAncestors; | setEntries setAncestors; | ||||
uint64_t nNoLimit = std::numeric_limits<uint64_t>::max(); | uint64_t nNoLimit = std::numeric_limits<uint64_t>::max(); | ||||
std::string dummy; | std::string dummy; | ||||
CalculateMemPoolAncestors(entry, setAncestors, nNoLimit, nNoLimit, nNoLimit, | CalculateMemPoolAncestors(entry, setAncestors, nNoLimit, nNoLimit, nNoLimit, | ||||
nNoLimit, dummy); | nNoLimit, dummy); | ||||
return addUnchecked(hash, entry, setAncestors, validFeeEstimate); | return addUnchecked(hash, entry, setAncestors); | ||||
} | } | ||||
void CTxMemPool::UpdateChild(txiter entry, txiter child, bool add) { | void CTxMemPool::UpdateChild(txiter entry, txiter child, bool add) { | ||||
setEntries s; | setEntries s; | ||||
if (add && mapLinks[entry].children.insert(child).second) { | if (add && mapLinks[entry].children.insert(child).second) { | ||||
cachedInnerUsage += memusage::IncrementalDynamicUsage(s); | cachedInnerUsage += memusage::IncrementalDynamicUsage(s); | ||||
} else if (!add && mapLinks[entry].children.erase(child)) { | } else if (!add && mapLinks[entry].children.erase(child)) { | ||||
cachedInnerUsage -= memusage::IncrementalDynamicUsage(s); | cachedInnerUsage -= memusage::IncrementalDynamicUsage(s); | ||||
▲ Show 20 Lines • Show All 269 Lines • Show Last 20 Lines |