aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-01-15 16:10:13 +0000
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-01-24 15:52:05 +0000
commit31dbd5af4863d73c3215355ec5cf85bde2ddc5d8 (patch)
treec016eae3dcae0487243260c97342651d2a90a4a0 /src/wallet/wallet.cpp
parent95941396fff81f60d75fc8cca70716b26efe820e (diff)
[wallet] Add change type to CCoinControl
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 7fb26900e1..07a23ce249 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2674,11 +2674,11 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nC
return true;
}
-OutputType CWallet::TransactionChangeType(const std::vector<CRecipient>& vecSend)
+OutputType CWallet::TransactionChangeType(OutputType change_type, const std::vector<CRecipient>& vecSend)
{
// If -changetype is specified, always use that change type.
- if (g_change_type != OUTPUT_TYPE_NONE) {
- return g_change_type;
+ if (change_type != OUTPUT_TYPE_NONE) {
+ return change_type;
}
// if g_address_type is legacy, use legacy address as change (even
@@ -2797,7 +2797,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
return false;
}
- const OutputType change_type = TransactionChangeType(vecSend);
+ const OutputType change_type = TransactionChangeType(coin_control.change_type, vecSend);
LearnRelatedScripts(vchPubKey, change_type);
scriptChange = GetScriptForDestination(GetDestinationForKey(vchPubKey, change_type));