diff options
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 4241d51d15..7b586c45b8 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -35,7 +35,7 @@ #include <policy/policy.h> #include <policy/rbf.h> #include <policy/settings.h> -#include <policy/v3_policy.h> +#include <policy/truc_policy.h> #include <pow.h> #include <primitives/block.h> #include <primitives/transaction.h> @@ -336,7 +336,7 @@ void Chainstate::MaybeUpdateMempoolForReorg( // Also updates valid entries' cached LockPoints if needed. // If false, the tx is still valid and its lockpoints are updated. // If true, the tx would be invalid in the next block; remove this entry and all of its descendants. - // Note that v3 rules are not applied here, so reorgs may cause violations of v3 inheritance or + // Note that TRUC rules are not applied here, so reorgs may cause violations of TRUC inheritance or // topology restrictions. const auto filter_final_and_mature = [&](CTxMemPool::txiter it) EXCLUSIVE_LOCKS_REQUIRED(m_mempool->cs, ::cs_main) { @@ -829,7 +829,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) // check all unconfirmed ancestors; otherwise an opt-in ancestor // might be replaced, causing removal of this descendant. // - // All V3 transactions are considered replaceable. + // All TRUC transactions are considered replaceable. // // Replaceability signaling of the original transactions may be // ignored due to node setting. @@ -936,7 +936,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) // while a tx could be package CPFP'd when entering the mempool, we do not have a DoS-resistant // method of ensuring the tx remains bumped. For example, the fee-bumping child could disappear // due to a replacement. - // The only exception is v3 transactions. + // The only exception is TRUC transactions. if (!bypass_limits && ws.m_ptx->version != TRUC_VERSION && ws.m_modified_fees < m_pool.m_opts.min_relay_feerate.GetFee(ws.m_vsize)) { // Even though this is a fee-related failure, this result is TX_MEMPOOL_POLICY, not // TX_RECONSIDERABLE, because it cannot be bypassed using package validation. @@ -1005,7 +1005,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) // If the new transaction is relatively small (up to 40k weight) // and has at most one ancestor (ie ancestor limit of 2, including // the new transaction), allow it if its parent has exactly the - // descendant limit descendants. The transaction also cannot be v3, + // descendant limit descendants. The transaction also cannot be TRUC, // as its topology restrictions do not allow a second child. // // This allows protocols which rely on distrusting counterparties @@ -1032,7 +1032,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) // Even though just checking direct mempool parents for inheritance would be sufficient, we // check using the full ancestor set here because it's more convenient to use what we have // already calculated. - if (const auto err{SingleV3Checks(ws.m_ptx, ws.m_ancestors, ws.m_conflicts, ws.m_vsize)}) { + if (const auto err{SingleTRUCChecks(ws.m_ptx, ws.m_ancestors, ws.m_conflicts, ws.m_vsize)}) { // Single transaction contexts only. if (args.m_allow_sibling_eviction && err->second != nullptr) { // We should only be considering where replacement is considered valid as well. @@ -1043,15 +1043,15 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) ws.m_conflicts.insert(err->second->GetHash()); // Adding the sibling to m_iters_conflicting here means that it doesn't count towards // RBF Carve Out above. This is correct, since removing to-be-replaced transactions from - // the descendant count is done separately in SingleV3Checks for v3 transactions. + // the descendant count is done separately in SingleTRUCChecks for TRUC transactions. ws.m_iters_conflicting.insert(m_pool.GetIter(err->second->GetHash()).value()); ws.m_sibling_eviction = true; // The sibling will be treated as part of the to-be-replaced set in ReplacementChecks. - // Note that we are not checking whether it opts in to replaceability via BIP125 or v3 - // (which is normally done in PreChecks). However, the only way a v3 transaction can - // have a non-v3 and non-BIP125 descendant is due to a reorg. + // Note that we are not checking whether it opts in to replaceability via BIP125 or TRUC + // (which is normally done in PreChecks). However, the only way a TRUC transaction can + // have a non-TRUC and non-BIP125 descendant is due to a reorg. } else { - return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "v3-rule-violation", err->first); + return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "TRUC-violation", err->first); } } @@ -1103,7 +1103,7 @@ bool MemPoolAccept::ReplacementChecks(Workspace& ws) } // Enforce Rule #2. if (const auto err_string{HasNoNewUnconfirmed(tx, m_pool, m_subpackage.m_all_conflicts)}) { - // Sibling eviction is only done for v3 transactions, which cannot have multiple ancestors. + // Sibling eviction is only done for TRUC transactions, which cannot have multiple ancestors. Assume(!ws.m_sibling_eviction); return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, strprintf("replacement-adds-unconfirmed%s", ws.m_sibling_eviction ? " (including sibling eviction)" : ""), *err_string); @@ -1545,10 +1545,10 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptMultipleTransactions(const std:: } // At this point we have all in-mempool ancestors, and we know every transaction's vsize. - // Run the v3 checks on the package. + // Run the TRUC checks on the package. for (Workspace& ws : workspaces) { - if (auto err{PackageV3Checks(ws.m_ptx, ws.m_vsize, txns, ws.m_ancestors)}) { - package_state.Invalid(PackageValidationResult::PCKG_POLICY, "v3-violation", err.value()); + if (auto err{PackageTRUCChecks(ws.m_ptx, ws.m_vsize, txns, ws.m_ancestors)}) { + package_state.Invalid(PackageValidationResult::PCKG_POLICY, "TRUC-violation", err.value()); return PackageMempoolAcceptResult(package_state, {}); } } |