aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-03-19 16:55:18 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-03-19 17:05:35 +0100
commitc39dd2ef59c986576726cc356a27165486fd0d65 (patch)
treec2cd0eadc85324335722dbd25fc897d37197840e /src/wallet/wallet.h
parent6324c68aa017ceb48fe3edfb5a2b141fcf0090fa (diff)
parentfab8a6f609d15863545955d6523c616c2a97eeab (diff)
downloadbitcoin-c39dd2ef59c986576726cc356a27165486fd0d65.tar.xz
Merge #12408: wallet: Change output type globals to members
fab8a6f60 wallet: Change output type globals to members (MarcoFalke) Pull request description: Output type is used by the wallet when generating addresses or transactions with change, thus it should be a member of `CWallet`. Moreover, in light of multiwallet, it makes sense to prepare for per-wallet attributes instead of for-all-wallets globals. Tree-SHA512: 4fa397cd82522e5bacf4870160a2a0f5e1f2dc046e4b9e2514dee18b187a0e1724d036315f77fa48e48f85533021d5e5525d798160a92d389d75512f3f9e1405
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r--src/wallet/wallet.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index dc0e8d07d7..5ac8457eb4 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -43,6 +43,7 @@ extern bool bSpendZeroConfChange;
extern bool fWalletRbf;
extern bool g_wallet_allow_fallback_fee;
+//! Default for -keypool
static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000;
//! -paytxfee default
static const CAmount DEFAULT_TRANSACTION_FEE = 0;
@@ -96,18 +97,15 @@ enum WalletFeature
FEATURE_LATEST = FEATURE_COMPRPUBKEY // HD is optional, use FEATURE_COMPRPUBKEY as latest version
};
-enum OutputType : int
-{
- OUTPUT_TYPE_NONE,
- OUTPUT_TYPE_LEGACY,
- OUTPUT_TYPE_P2SH_SEGWIT,
- OUTPUT_TYPE_BECH32,
-
- OUTPUT_TYPE_DEFAULT = OUTPUT_TYPE_P2SH_SEGWIT
+enum class OutputType {
+ NONE,
+ LEGACY,
+ P2SH_SEGWIT,
+ BECH32,
};
-extern OutputType g_address_type;
-extern OutputType g_change_type;
+//! Default for -addresstype
+constexpr OutputType DEFAULT_ADDRESS_TYPE{OutputType::P2SH_SEGWIT};
/** A key pool entry */
@@ -989,6 +987,8 @@ public:
static CFeeRate minTxFee;
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
bool NewKeyPool();
size_t KeypoolCountExternalKeys();
@@ -1232,7 +1232,7 @@ public:
}
};
-OutputType ParseOutputType(const std::string& str, OutputType default_type = OUTPUT_TYPE_DEFAULT);
+OutputType ParseOutputType(const std::string& str, OutputType default_type);
const std::string& FormatOutputType(OutputType type);
/**