mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
Use mempool/txgraph to determine if a tx has descendants
Remove a reference to GetCountWithDescendants() in preparation for removing this function and the associated cached state from the mempool.
This commit is contained in:
@@ -229,6 +229,14 @@ util::Result<void> CTxMemPool::CheckPackageLimits(const Package& package,
|
||||
return {};
|
||||
}
|
||||
|
||||
bool CTxMemPool::HasDescendants(const Txid& txid) const
|
||||
{
|
||||
LOCK(cs);
|
||||
auto entry = GetEntry(txid);
|
||||
if (!entry) return false;
|
||||
return m_txgraph->GetDescendants(*entry, TxGraph::Level::MAIN).size() > 1;
|
||||
}
|
||||
|
||||
util::Result<CTxMemPool::setEntries> CTxMemPool::CalculateMemPoolAncestors(
|
||||
const CTxMemPoolEntry &entry,
|
||||
const Limits& limits,
|
||||
|
||||
Reference in New Issue
Block a user