mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-09-06 20:52:08 +02:00
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:
@@ -109,10 +109,10 @@ public:
|
|||||||
int m_max_depth = DEFAULT_MAX_DEPTH;
|
int m_max_depth = DEFAULT_MAX_DEPTH;
|
||||||
//! SigningProvider that has pubkeys and scripts to do spend size estimation for external inputs
|
//! SigningProvider that has pubkeys and scripts to do spend size estimation for external inputs
|
||||||
FlatSigningProvider m_external_provider;
|
FlatSigningProvider m_external_provider;
|
||||||
|
//! Version
|
||||||
|
uint32_t m_version = CTransaction::CURRENT_VERSION;
|
||||||
//! Locktime
|
//! Locktime
|
||||||
std::optional<uint32_t> m_locktime;
|
std::optional<uint32_t> m_locktime;
|
||||||
//! Version
|
|
||||||
std::optional<uint32_t> m_version;
|
|
||||||
//! Caps weight of resulting tx
|
//! Caps weight of resulting tx
|
||||||
std::optional<int> m_max_tx_weight{std::nullopt};
|
std::optional<int> m_max_tx_weight{std::nullopt};
|
||||||
|
|
||||||
|
@@ -1032,9 +1032,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
|
|||||||
FastRandomContext rng_fast;
|
FastRandomContext rng_fast;
|
||||||
CMutableTransaction txNew; // The resulting transaction that we make
|
CMutableTransaction txNew; // The resulting transaction that we make
|
||||||
|
|
||||||
if (coin_control.m_version) {
|
txNew.version = coin_control.m_version;
|
||||||
txNew.version = coin_control.m_version.value();
|
|
||||||
}
|
|
||||||
|
|
||||||
CoinSelectionParams coin_selection_params{rng_fast}; // Parameters for coin selection, init with dummy
|
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;
|
coin_selection_params.m_avoid_partial_spends = coin_control.m_avoid_partial_spends;
|
||||||
|
Reference in New Issue
Block a user