mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-04 13:55:23 -05:00
Handle over-sized (in virtual bytes) packages with no in-mempool ancestors
This commit is contained in:
parent
bc013fe8e3
commit
1a579f9d01
1 changed files with 17 additions and 0 deletions
|
@ -200,6 +200,23 @@ bool CTxMemPool::CheckPackageLimits(const Package& package,
|
|||
const int64_t total_vsize,
|
||||
std::string &errString) const
|
||||
{
|
||||
size_t pack_count = package.size();
|
||||
|
||||
// Package itself is busting mempool limits; should be rejected even if no staged_ancestors exist
|
||||
if (pack_count > static_cast<uint64_t>(m_limits.ancestor_count)) {
|
||||
errString = strprintf("package count %u exceeds ancestor count limit [limit: %u]", pack_count, m_limits.ancestor_count);
|
||||
return false;
|
||||
} else if (pack_count > static_cast<uint64_t>(m_limits.descendant_count)) {
|
||||
errString = strprintf("package count %u exceeds descendant count limit [limit: %u]", pack_count, m_limits.descendant_count);
|
||||
return false;
|
||||
} else if (total_vsize > m_limits.ancestor_size_vbytes) {
|
||||
errString = strprintf("package size %u exceeds ancestor size limit [limit: %u]", total_vsize, m_limits.ancestor_size_vbytes);
|
||||
return false;
|
||||
} else if (total_vsize > m_limits.descendant_size_vbytes) {
|
||||
errString = strprintf("package size %u exceeds descendant size limit [limit: %u]", total_vsize, m_limits.descendant_size_vbytes);
|
||||
return false;
|
||||
}
|
||||
|
||||
CTxMemPoolEntry::Parents staged_ancestors;
|
||||
for (const auto& tx : package) {
|
||||
for (const auto& input : tx->vin) {
|
||||
|
|
Loading…
Add table
Reference in a new issue