@@ -2490,7 +2490,8 @@ bool CWallet::CreateTransaction(interfaces::Chain::Lock& locked_chain, const std
2490
2490
int & nChangePosInOut, std::string& strFailReason, const CCoinControl& coin_control, bool sign)
2491
2491
{
2492
2492
CAmount nValue = 0 ;
2493
- ReserveDestination reservedest (this );
2493
+ const OutputType change_type = TransactionChangeType (coin_control.m_change_type ? *coin_control.m_change_type : m_default_change_type, vecSend);
2494
+ ReserveDestination reservedest (this , change_type);
2494
2495
int nChangePosRequest = nChangePosInOut;
2495
2496
unsigned int nSubtractFeeFromAmount = 0 ;
2496
2497
for (const auto & recipient : vecSend)
@@ -2549,8 +2550,7 @@ bool CWallet::CreateTransaction(interfaces::Chain::Lock& locked_chain, const std
2549
2550
return false ;
2550
2551
}
2551
2552
CTxDestination dest;
2552
- const OutputType change_type = TransactionChangeType (coin_control.m_change_type ? *coin_control.m_change_type : m_default_change_type, vecSend);
2553
- bool ret = reservedest.GetReservedDestination (change_type, dest, true );
2553
+ bool ret = reservedest.GetReservedDestination (dest, true );
2554
2554
if (!ret)
2555
2555
{
2556
2556
strFailReason = " Keypool ran out, please call keypoolrefill first" ;
@@ -3069,8 +3069,8 @@ bool CWallet::GetNewChangeDestination(const OutputType type, CTxDestination& des
3069
3069
3070
3070
m_spk_man->TopUp ();
3071
3071
3072
- ReserveDestination reservedest (this );
3073
- if (!reservedest.GetReservedDestination (type, dest, true )) {
3072
+ ReserveDestination reservedest (this , type );
3073
+ if (!reservedest.GetReservedDestination (dest, true )) {
3074
3074
error = " Error: Keypool ran out, please call keypoolrefill first" ;
3075
3075
return false ;
3076
3076
}
@@ -3235,7 +3235,7 @@ std::set<CTxDestination> CWallet::GetLabelAddresses(const std::string& label) co
3235
3235
return result;
3236
3236
}
3237
3237
3238
- bool ReserveDestination::GetReservedDestination (const OutputType type, CTxDestination& dest, bool internal)
3238
+ bool ReserveDestination::GetReservedDestination (CTxDestination& dest, bool internal)
3239
3239
{
3240
3240
m_spk_man = pwallet->GetLegacyScriptPubKeyMan ();
3241
3241
if (!m_spk_man) {
0 commit comments