diff options
Diffstat (limited to 'src/test/util')
-rw-r--r-- | src/test/util/txmempool.cpp | 22 | ||||
-rw-r--r-- | src/test/util/txmempool.h | 14 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/test/util/txmempool.cpp b/src/test/util/txmempool.cpp index 94d50bba50..9d6b4810d0 100644 --- a/src/test/util/txmempool.cpp +++ b/src/test/util/txmempool.cpp @@ -8,7 +8,7 @@ #include <node/context.h> #include <node/mempool_args.h> #include <policy/rbf.h> -#include <policy/v3_policy.h> +#include <policy/truc_policy.h> #include <txmempool.h> #include <util/check.h> #include <util/time.h> @@ -141,30 +141,30 @@ std::optional<std::string> CheckPackageMempoolAcceptResult(const Package& txns, return std::nullopt; } -void CheckMempoolV3Invariants(const CTxMemPool& tx_pool) +void CheckMempoolTRUCInvariants(const CTxMemPool& tx_pool) { LOCK(tx_pool.cs); for (const auto& tx_info : tx_pool.infoAll()) { const auto& entry = *Assert(tx_pool.GetEntry(tx_info.tx->GetHash())); if (tx_info.tx->version == TRUC_VERSION) { // Check that special maximum virtual size is respected - Assert(entry.GetTxSize() <= V3_MAX_VSIZE); + Assert(entry.GetTxSize() <= TRUC_MAX_VSIZE); - // Check that special v3 ancestor/descendant limits and rules are always respected - Assert(entry.GetCountWithDescendants() <= V3_DESCENDANT_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); + // Check that special TRUC ancestor/descendant limits and rules are always respected + Assert(entry.GetCountWithDescendants() <= TRUC_DESCENDANT_LIMIT); + Assert(entry.GetCountWithAncestors() <= TRUC_ANCESTOR_LIMIT); + Assert(entry.GetSizeWithDescendants() <= TRUC_MAX_VSIZE + TRUC_CHILD_MAX_VSIZE); + Assert(entry.GetSizeWithAncestors() <= TRUC_MAX_VSIZE + TRUC_CHILD_MAX_VSIZE); // If this transaction has at least 1 ancestor, it's a "child" and has restricted weight. if (entry.GetCountWithAncestors() > 1) { - Assert(entry.GetTxSize() <= V3_CHILD_MAX_VSIZE); - // All v3 transactions must only have v3 unconfirmed parents. + Assert(entry.GetTxSize() <= TRUC_CHILD_MAX_VSIZE); + // All TRUC transactions must only have TRUC unconfirmed parents. const auto& parents = entry.GetMemPoolParentsConst(); Assert(parents.begin()->get().GetSharedTx()->version == TRUC_VERSION); } } else if (entry.GetCountWithAncestors() > 1) { - // All non-v3 transactions must only have non-v3 unconfirmed parents. + // All non-TRUC transactions must only have non-TRUC unconfirmed parents. for (const auto& parent : entry.GetMemPoolParentsConst()) { Assert(parent.get().GetSharedTx()->version != TRUC_VERSION); } diff --git a/src/test/util/txmempool.h b/src/test/util/txmempool.h index b3022af7df..6d41fdf87f 100644 --- a/src/test/util/txmempool.h +++ b/src/test/util/txmempool.h @@ -47,13 +47,13 @@ std::optional<std::string> CheckPackageMempoolAcceptResult(const Package& txns, bool expect_valid, const CTxMemPool* mempool); -/** For every transaction in tx_pool, check v3 invariants: - * - a v3 tx's ancestor count must be within V3_ANCESTOR_LIMIT - * - a v3 tx's descendant count must be within V3_DESCENDANT_LIMIT - * - if a v3 tx has ancestors, its sigop-adjusted vsize must be within V3_CHILD_MAX_VSIZE - * - any non-v3 tx must only have non-v3 parents - * - any v3 tx must only have v3 parents +/** For every transaction in tx_pool, check TRUC invariants: + * - a TRUC tx's ancestor count must be within TRUC_ANCESTOR_LIMIT + * - a TRUC tx's descendant count must be within TRUC_DESCENDANT_LIMIT + * - if a TRUC tx has ancestors, its sigop-adjusted vsize must be within TRUC_CHILD_MAX_VSIZE + * - any non-TRUC tx must only have non-TRUC parents + * - any TRUC tx must only have TRUC parents * */ -void CheckMempoolV3Invariants(const CTxMemPool& tx_pool); +void CheckMempoolTRUCInvariants(const CTxMemPool& tx_pool); #endif // BITCOIN_TEST_UTIL_TXMEMPOOL_H |