mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
[fuzz] V3_MAX_VSIZE and effective ancestor/descendant size limits
This commit is contained in:
parent
a29f1df289
commit
154b2b2296
1 changed files with 6 additions and 0 deletions
|
@ -125,9 +125,15 @@ void CheckMempoolV3Invariants(const CTxMemPool& tx_pool)
|
||||||
for (const auto& tx_info : tx_pool.infoAll()) {
|
for (const auto& tx_info : tx_pool.infoAll()) {
|
||||||
const auto& entry = *Assert(tx_pool.GetEntry(tx_info.tx->GetHash()));
|
const auto& entry = *Assert(tx_pool.GetEntry(tx_info.tx->GetHash()));
|
||||||
if (tx_info.tx->nVersion == 3) {
|
if (tx_info.tx->nVersion == 3) {
|
||||||
|
// Check that special maximum virtual size is respected
|
||||||
|
Assert(entry.GetTxSize() <= V3_MAX_VSIZE);
|
||||||
|
|
||||||
// Check that special v3 ancestor/descendant limits and rules are always respected
|
// Check that special v3 ancestor/descendant limits and rules are always respected
|
||||||
Assert(entry.GetCountWithDescendants() <= V3_DESCENDANT_LIMIT);
|
Assert(entry.GetCountWithDescendants() <= V3_DESCENDANT_LIMIT);
|
||||||
Assert(entry.GetCountWithAncestors() <= V3_ANCESTOR_LIMIT);
|
Assert(entry.GetCountWithAncestors() <= V3_ANCESTOR_LIMIT);
|
||||||
|
Assert(entry.GetSizeWithDescendants() <= V3_MAX_VSIZE + V3_CHILD_MAX_VSIZE);
|
||||||
|
Assert(entry.GetSizeWithAncestors() <= V3_MAX_VSIZE + V3_CHILD_MAX_VSIZE);
|
||||||
|
|
||||||
// If this transaction has at least 1 ancestor, it's a "child" and has restricted weight.
|
// If this transaction has at least 1 ancestor, it's a "child" and has restricted weight.
|
||||||
if (entry.GetCountWithAncestors() > 1) {
|
if (entry.GetCountWithAncestors() > 1) {
|
||||||
Assert(entry.GetTxSize() <= V3_CHILD_MAX_VSIZE);
|
Assert(entry.GetTxSize() <= V3_CHILD_MAX_VSIZE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue