diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index bff94f603e..d40e805171 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -316,6 +316,7 @@ CoinsResult AvailableCoins(const CWallet& wallet, const int min_depth = {coinControl ? coinControl->m_min_depth : DEFAULT_MIN_DEPTH}; const int max_depth = {coinControl ? coinControl->m_max_depth : DEFAULT_MAX_DEPTH}; const bool only_safe = {coinControl ? !coinControl->m_include_unsafe_inputs : true}; + const bool segwit_inputs_only = {coinControl ? coinControl->m_segwit_inputs_only : false}; const bool can_grind_r = wallet.CanGrindR(); std::vector outpoints; @@ -409,7 +410,7 @@ CoinsResult AvailableCoins(const CWallet& wallet, std::unique_ptr provider = wallet.GetSolvingProvider(output.scriptPubKey); - if (coinControl && coinControl->m_segwit_inputs_only && !IsSegWitOutput(*provider, wtx.tx->vout[i].scriptPubKey)) { + if (segwit_inputs_only && !IsSegWitOutput(*provider, wtx.tx->vout[i].scriptPubKey)) { continue; }