wallet: set m_version in coin control to default value

In future commits we assume that coin_control.m_version has a
value when making sure that we follow truc rules, so we should
give it a default value of CTransaction::CURRENT_VERSION.
This commit is contained in:
ishaanam committed 2025-08-15 10:45:36 -04:00
1 parent 2e9617664e
commit cc155226fe
2 files changed
+3 -5

No files matched your search

+2 -2
View File
@@ -109,10 +109,10 @@ public:
int m_max_depth = DEFAULT_MAX_DEPTH;
//! SigningProvider that has pubkeys and scripts to do spend size estimation for external inputs
FlatSigningProvider m_external_provider;
//! Version
uint32_t m_version = CTransaction::CURRENT_VERSION;
//! Locktime
std::optional<uint32_t> m_locktime;
//! Version
std::optional<uint32_t> m_version;
//! Caps weight of resulting tx
std::optional<int> m_max_tx_weight{std::nullopt};
+1 -3
View File
@@ -1032,9 +1032,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
FastRandomContext rng_fast;
CMutableTransaction txNew; // The resulting transaction that we make
if (coin_control.m_version) {
txNew.version = coin_control.m_version.value();
}
txNew.version = coin_control.m_version;
CoinSelectionParams coin_selection_params{rng_fast}; // Parameters for coin selection, init with dummy
coin_selection_params.m_avoid_partial_spends = coin_control.m_avoid_partial_spends;