mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 21:22:47 +01:00
Remove MemPoolAccept::m_limits, only have local copies for carveouts
This commit is contained in:
@@ -197,7 +197,6 @@ util::Result<CTxMemPool::setEntries> CTxMemPool::CalculateAncestorsAndCheckLimit
|
||||
}
|
||||
|
||||
bool CTxMemPool::CheckPackageLimits(const Package& package,
|
||||
const Limits& limits,
|
||||
std::string &errString) const
|
||||
{
|
||||
CTxMemPoolEntry::Parents staged_ancestors;
|
||||
@@ -208,8 +207,8 @@ bool CTxMemPool::CheckPackageLimits(const Package& package,
|
||||
std::optional<txiter> piter = GetIter(input.prevout.hash);
|
||||
if (piter) {
|
||||
staged_ancestors.insert(**piter);
|
||||
if (staged_ancestors.size() + package.size() > static_cast<uint64_t>(limits.ancestor_count)) {
|
||||
errString = strprintf("too many unconfirmed parents [limit: %u]", limits.ancestor_count);
|
||||
if (staged_ancestors.size() + package.size() > static_cast<uint64_t>(m_limits.ancestor_count)) {
|
||||
errString = strprintf("too many unconfirmed parents [limit: %u]", m_limits.ancestor_count);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -219,7 +218,7 @@ bool CTxMemPool::CheckPackageLimits(const Package& package,
|
||||
// considered together must be within limits even if they are not interdependent. This may be
|
||||
// stricter than the limits for each individual transaction.
|
||||
const auto ancestors{CalculateAncestorsAndCheckLimits(total_size, package.size(),
|
||||
staged_ancestors, limits)};
|
||||
staged_ancestors, m_limits)};
|
||||
// It's possible to overestimate the ancestor/descendant totals.
|
||||
if (!ancestors.has_value()) errString = "possibly " + util::ErrorString(ancestors).original;
|
||||
return ancestors.has_value();
|
||||
|
||||
Reference in New Issue
Block a user