diff --git a/src/wallet/coincontrol.h b/src/wallet/coincontrol.h index d7075bc8d6e..1cba19af6bf 100644 --- a/src/wallet/coincontrol.h +++ b/src/wallet/coincontrol.h @@ -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 m_locktime; - //! Version - std::optional m_version; //! Caps weight of resulting tx std::optional m_max_tx_weight{std::nullopt}; diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index a44cc409136..91cdc4a894c 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -1032,9 +1032,7 @@ static util::Result 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;