diff --git a/src/policy/truc_policy.h b/src/policy/truc_policy.h index dbc77696c67..acd8ae56b1c 100644 --- a/src/policy/truc_policy.h +++ b/src/policy/truc_policy.h @@ -28,8 +28,10 @@ static constexpr unsigned int TRUC_ANCESTOR_LIMIT{2}; /** Maximum sigop-adjusted virtual size of all v3 transactions. */ static constexpr int64_t TRUC_MAX_VSIZE{10000}; +static constexpr int64_t TRUC_MAX_WEIGHT{TRUC_MAX_VSIZE * WITNESS_SCALE_FACTOR}; /** Maximum sigop-adjusted virtual size of a tx which spends from an unconfirmed TRUC transaction. */ static constexpr int64_t TRUC_CHILD_MAX_VSIZE{1000}; +static constexpr int64_t TRUC_CHILD_MAX_WEIGHT{TRUC_CHILD_MAX_VSIZE * WITNESS_SCALE_FACTOR}; // These limits are within the default ancestor/descendant limits. static_assert(TRUC_MAX_VSIZE + TRUC_CHILD_MAX_VSIZE <= DEFAULT_ANCESTOR_SIZE_LIMIT_KVB * 1000); static_assert(TRUC_MAX_VSIZE + TRUC_CHILD_MAX_VSIZE <= DEFAULT_DESCENDANT_SIZE_LIMIT_KVB * 1000); diff --git a/src/wallet/coinselection.h b/src/wallet/coinselection.h index 08889c8e060..c86765c4a50 100644 --- a/src/wallet/coinselection.h +++ b/src/wallet/coinselection.h @@ -174,6 +174,8 @@ struct CoinSelectionParams { * 1) Received from other wallets, 2) replacing other txs, 3) that have been replaced. */ bool m_include_unsafe_inputs = false; + /** The version of the transaction we are trying to create. */ + uint32_t m_version{CTransaction::CURRENT_VERSION}; /** The maximum weight for this transaction. */ std::optional m_max_tx_weight{std::nullopt}; diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp index 8d120cc38aa..b643183e0ee 100644 --- a/src/wallet/rpc/spend.cpp +++ b/src/wallet/rpc/spend.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include