diff options
author | Ava Chow <github@achow101.com> | 2024-01-26 15:27:13 -0500 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-06-07 13:55:23 -0400 |
commit | 429ec1aaaaafab150f11e27fcf132a99b57c4fc7 (patch) | |
tree | e09999b341f124bf12712f5111d563a9003f1872 /src/wallet/spend.cpp | |
parent | 27e70f1f5be1f536f2314cd2ea42b4f80d927fbd (diff) | |
download | bitcoin-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/wallet/spend.cpp')
-rw-r--r-- | src/wallet/spend.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index 2322471402..7b86ad388d 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -132,7 +132,7 @@ static std::optional<int64_t> GetSignedTxinWeight(const CWallet* wallet, const C // txouts needs to be in the order of tx.vin TxSize CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *wallet, const std::vector<CTxOut>& txouts, const CCoinControl* coin_control) { - // nVersion + nLockTime + input count + output count + // version + nLockTime + input count + output count int64_t weight = (4 + 4 + GetSizeOfCompactSize(tx.vin.size()) + GetSizeOfCompactSize(tx.vout.size())) * WITNESS_SCALE_FACTOR; // Whether any input spends a witness program. Necessary to run before the next loop over the // inputs in order to accurately compute the compactSize length for the witness data per input. @@ -985,7 +985,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal( CMutableTransaction txNew; // The resulting transaction that we make if (coin_control.m_version) { - txNew.nVersion = coin_control.m_version.value(); + txNew.version = coin_control.m_version.value(); } CoinSelectionParams coin_selection_params{rng_fast}; // Parameters for coin selection, init with dummy @@ -1084,7 +1084,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal( const auto change_spend_fee = coin_selection_params.m_discard_feerate.GetFee(coin_selection_params.change_spend_size); coin_selection_params.min_viable_change = std::max(change_spend_fee + 1, dust); - // Static vsize overhead + outputs vsize. 4 nVersion, 4 nLocktime, 1 input count, 1 witness overhead (dummy, flag, stack size) + // Static vsize overhead + outputs vsize. 4 version, 4 nLocktime, 1 input count, 1 witness overhead (dummy, flag, stack size) coin_selection_params.tx_noinputs_size = 10 + GetSizeOfCompactSize(vecSend.size()); // bytes for output count // vouts to the payees @@ -1394,7 +1394,7 @@ util::Result<CreatedTransactionResult> FundTransaction(CWallet& wallet, const CM coinControl.m_locktime = tx.nLockTime; // Set the user desired version - coinControl.m_version = tx.nVersion; + coinControl.m_version = tx.version; // Acquire the locks to prevent races to the new locked unspents between the // CreateTransaction call and LockCoin calls (when lockUnspents is true). |