diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index fbda77ed62c..0f693026971 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1909,7 +1909,13 @@ OutputType CWallet::TransactionChangeType(const std::optional& chang int witnessversion = 0; std::vector witnessprogram; if (recipient.scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) { - return OutputType::BECH32; + if (GetScriptPubKeyMan(OutputType::BECH32M, true)) { + return OutputType::BECH32M; + } else if (GetScriptPubKeyMan(OutputType::BECH32, true)) { + return OutputType::BECH32; + } else { + return m_default_address_type; + } } }