diff options
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r-- | src/wallet/wallet.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 898c32c708..1d85fbcea1 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -99,15 +99,24 @@ enum WalletFeature }; enum class OutputType { - NONE, LEGACY, P2SH_SEGWIT, BECH32, + + /** + * Special output type for change outputs only. Automatically choose type + * based on address type setting and the types other of non-change outputs + * (see -changetype option documentation and implementation in + * CWallet::TransactionChangeType for details). + */ + CHANGE_AUTO, }; //! Default for -addresstype constexpr OutputType DEFAULT_ADDRESS_TYPE{OutputType::P2SH_SEGWIT}; +//! Default for -changetype +constexpr OutputType DEFAULT_CHANGE_TYPE{OutputType::CHANGE_AUTO}; /** A key pool entry */ class CKeyPool @@ -988,7 +997,7 @@ public: static CFeeRate fallbackFee; static CFeeRate m_discard_rate; OutputType m_default_address_type{DEFAULT_ADDRESS_TYPE}; - OutputType m_default_change_type{OutputType::NONE}; // Default to OutputType::NONE if not set by -changetype + OutputType m_default_change_type{DEFAULT_CHANGE_TYPE}; bool NewKeyPool(); size_t KeypoolCountExternalKeys(); @@ -1232,7 +1241,7 @@ public: } }; -OutputType ParseOutputType(const std::string& str, OutputType default_type); +bool ParseOutputType(const std::string& str, OutputType& output_type); const std::string& FormatOutputType(OutputType type); /** |