aboutsummaryrefslogtreecommitdiff
path: root/src/test/util
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-01-26 15:27:13 -0500
committerAva Chow <github@achow101.com>2024-06-07 13:55:23 -0400
commit429ec1aaaaafab150f11e27fcf132a99b57c4fc7 (patch)
treee09999b341f124bf12712f5111d563a9003f1872 /src/test/util
parent27e70f1f5be1f536f2314cd2ea42b4f80d927fbd (diff)
downloadbitcoin-429ec1aaaaafab150f11e27fcf132a99b57c4fc7.tar.xz
refactor: Rename CTransaction::nVersion to version
In order to ensure that the change of nVersion to a uint32_t in the previous commit has no effect, rename nVersion to version in this commit so that reviewers can easily spot if a spot was missed or if there is a check somewhere whose semantics have changed.
Diffstat (limited to 'src/test/util')
-rw-r--r--src/test/util/transaction_utils.cpp4
-rw-r--r--src/test/util/txmempool.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/test/util/transaction_utils.cpp b/src/test/util/transaction_utils.cpp
index 7e5bb30a2c..300caa577c 100644
--- a/src/test/util/transaction_utils.cpp
+++ b/src/test/util/transaction_utils.cpp
@@ -9,7 +9,7 @@
CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int nValue)
{
CMutableTransaction txCredit;
- txCredit.nVersion = 1;
+ txCredit.version = 1;
txCredit.nLockTime = 0;
txCredit.vin.resize(1);
txCredit.vout.resize(1);
@@ -25,7 +25,7 @@ CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int n
CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CTransaction& txCredit)
{
CMutableTransaction txSpend;
- txSpend.nVersion = 1;
+ txSpend.version = 1;
txSpend.nLockTime = 0;
txSpend.vin.resize(1);
txSpend.vout.resize(1);
diff --git a/src/test/util/txmempool.cpp b/src/test/util/txmempool.cpp
index 4dfc09ef67..249ce9503c 100644
--- a/src/test/util/txmempool.cpp
+++ b/src/test/util/txmempool.cpp
@@ -118,7 +118,7 @@ void CheckMempoolV3Invariants(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->nVersion == TRUC_VERSION) {
+ if (tx_info.tx->version == TRUC_VERSION) {
// Check that special maximum virtual size is respected
Assert(entry.GetTxSize() <= V3_MAX_VSIZE);
@@ -133,12 +133,12 @@ void CheckMempoolV3Invariants(const CTxMemPool& tx_pool)
Assert(entry.GetTxSize() <= V3_CHILD_MAX_VSIZE);
// All v3 transactions must only have v3 unconfirmed parents.
const auto& parents = entry.GetMemPoolParentsConst();
- Assert(parents.begin()->get().GetSharedTx()->nVersion == TRUC_VERSION);
+ Assert(parents.begin()->get().GetSharedTx()->version == TRUC_VERSION);
}
} else if (entry.GetCountWithAncestors() > 1) {
// All non-v3 transactions must only have non-v3 unconfirmed parents.
for (const auto& parent : entry.GetMemPoolParentsConst()) {
- Assert(parent.get().GetSharedTx()->nVersion != TRUC_VERSION);
+ Assert(parent.get().GetSharedTx()->version != TRUC_VERSION);
}
}
}