diff options
Diffstat (limited to 'src/policy')
-rw-r--r-- | src/policy/policy.cpp | 2 | ||||
-rw-r--r-- | src/policy/policy.h | 2 | ||||
-rw-r--r-- | src/policy/v3_policy.cpp | 24 | ||||
-rw-r--r-- | src/policy/v3_policy.h | 4 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index d8b4b907e4..e84a8428bf 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -93,7 +93,7 @@ bool IsStandard(const CScript& scriptPubKey, const std::optional<unsigned>& max_ bool IsStandardTx(const CTransaction& tx, const std::optional<unsigned>& max_datacarrier_bytes, bool permit_bare_multisig, const CFeeRate& dust_relay_fee, std::string& reason) { - if (tx.nVersion > TX_MAX_STANDARD_VERSION || tx.nVersion < 1) { + if (tx.version > TX_MAX_STANDARD_VERSION || tx.version < 1) { reason = "version"; return false; } diff --git a/src/policy/policy.h b/src/policy/policy.h index 20d632183a..a82488a28c 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -131,7 +131,7 @@ bool IsStandard(const CScript& scriptPubKey, const std::optional<unsigned>& max_ // Changing the default transaction version requires a two step process: first // adapting relay policy by bumping TX_MAX_STANDARD_VERSION, and then later // allowing the new transaction version in the wallet/RPC. -static constexpr decltype(CTransaction::nVersion) TX_MAX_STANDARD_VERSION{3}; +static constexpr decltype(CTransaction::version) TX_MAX_STANDARD_VERSION{3}; /** * Check for standard transaction types diff --git a/src/policy/v3_policy.cpp b/src/policy/v3_policy.cpp index 73c4d2a707..6bd043b8e3 100644 --- a/src/policy/v3_policy.cpp +++ b/src/policy/v3_policy.cpp @@ -43,13 +43,13 @@ struct ParentInfo { const Txid& m_txid; /** Wtxid used for debug string */ const Wtxid& m_wtxid; - /** nVersion used to check inheritance of v3 and non-v3 */ - decltype(CTransaction::nVersion) m_version; + /** version used to check inheritance of v3 and non-v3 */ + decltype(CTransaction::version) m_version; /** If parent is in mempool, whether it has any descendants in mempool. */ bool m_has_mempool_descendant; ParentInfo() = delete; - ParentInfo(const Txid& txid, const Wtxid& wtxid, decltype(CTransaction::nVersion) version, bool has_mempool_descendant) : + ParentInfo(const Txid& txid, const Wtxid& wtxid, decltype(CTransaction::version) version, bool has_mempool_descendant) : m_txid{txid}, m_wtxid{wtxid}, m_version{version}, m_has_mempool_descendant{has_mempool_descendant} {} @@ -66,7 +66,7 @@ std::optional<std::string> PackageV3Checks(const CTransactionRef& ptx, int64_t v const auto in_package_parents{FindInPackageParents(package, ptx)}; // Now we have all ancestors, so we can start checking v3 rules. - if (ptx->nVersion == TRUC_VERSION) { + if (ptx->version == TRUC_VERSION) { // SingleV3Checks should have checked this already. if (!Assume(vsize <= V3_MAX_VSIZE)) { return strprintf("v3 tx %s (wtxid=%s) is too big: %u > %u virtual bytes", @@ -93,14 +93,14 @@ std::optional<std::string> PackageV3Checks(const CTransactionRef& ptx, int64_t v auto& mempool_parent = *mempool_ancestors.begin(); return ParentInfo{mempool_parent->GetTx().GetHash(), mempool_parent->GetTx().GetWitnessHash(), - mempool_parent->GetTx().nVersion, + mempool_parent->GetTx().version, /*has_mempool_descendant=*/mempool_parent->GetCountWithDescendants() > 1}; } else { auto& parent_index = in_package_parents.front(); auto& package_parent = package.at(parent_index); return ParentInfo{package_parent->GetHash(), package_parent->GetWitnessHash(), - package_parent->nVersion, + package_parent->version, /*has_mempool_descendant=*/false}; } }(); @@ -142,14 +142,14 @@ std::optional<std::string> PackageV3Checks(const CTransactionRef& ptx, int64_t v } else { // Non-v3 transactions cannot have v3 parents. for (auto it : mempool_ancestors) { - if (it->GetTx().nVersion == TRUC_VERSION) { + if (it->GetTx().version == TRUC_VERSION) { return strprintf("non-v3 tx %s (wtxid=%s) cannot spend from v3 tx %s (wtxid=%s)", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), it->GetSharedTx()->GetHash().ToString(), it->GetSharedTx()->GetWitnessHash().ToString()); } } for (const auto& index: in_package_parents) { - if (package.at(index)->nVersion == TRUC_VERSION) { + if (package.at(index)->version == TRUC_VERSION) { return strprintf("non-v3 tx %s (wtxid=%s) cannot spend from v3 tx %s (wtxid=%s)", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), @@ -168,12 +168,12 @@ std::optional<std::pair<std::string, CTransactionRef>> SingleV3Checks(const CTra { // Check v3 and non-v3 inheritance. for (const auto& entry : mempool_ancestors) { - if (ptx->nVersion != TRUC_VERSION && entry->GetTx().nVersion == TRUC_VERSION) { + if (ptx->version != TRUC_VERSION && entry->GetTx().version == TRUC_VERSION) { return std::make_pair(strprintf("non-v3 tx %s (wtxid=%s) cannot spend from v3 tx %s (wtxid=%s)", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), entry->GetSharedTx()->GetHash().ToString(), entry->GetSharedTx()->GetWitnessHash().ToString()), nullptr); - } else if (ptx->nVersion == TRUC_VERSION && entry->GetTx().nVersion != TRUC_VERSION) { + } else if (ptx->version == TRUC_VERSION && entry->GetTx().version != TRUC_VERSION) { return std::make_pair(strprintf("v3 tx %s (wtxid=%s) cannot spend from non-v3 tx %s (wtxid=%s)", ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString(), entry->GetSharedTx()->GetHash().ToString(), entry->GetSharedTx()->GetWitnessHash().ToString()), @@ -185,8 +185,8 @@ std::optional<std::pair<std::string, CTransactionRef>> SingleV3Checks(const CTra static_assert(V3_ANCESTOR_LIMIT == 2); static_assert(V3_DESCENDANT_LIMIT == 2); - // The rest of the rules only apply to transactions with nVersion=3. - if (ptx->nVersion != TRUC_VERSION) return std::nullopt; + // The rest of the rules only apply to transactions with version=3. + if (ptx->version != TRUC_VERSION) return std::nullopt; if (vsize > V3_MAX_VSIZE) { return std::make_pair(strprintf("v3 tx %s (wtxid=%s) is too big: %u > %u virtual bytes", diff --git a/src/policy/v3_policy.h b/src/policy/v3_policy.h index 84dadd8719..90eaeda46f 100644 --- a/src/policy/v3_policy.h +++ b/src/policy/v3_policy.h @@ -15,9 +15,9 @@ #include <set> #include <string> -// This module enforces rules for BIP 431 TRUC transactions (with nVersion=3) which help make +// This module enforces rules for BIP 431 TRUC transactions (with version=3) which help make // RBF abilities more robust. -static constexpr decltype(CTransaction::nVersion) TRUC_VERSION{3}; +static constexpr decltype(CTransaction::version) TRUC_VERSION{3}; // v3 only allows 1 parent and 1 child when unconfirmed. /** Maximum number of transactions including an unconfirmed tx and its descendants. */ |