Skip to content

Commit aeac157

Browse files
committed
Return nullptr from GetLegacyScriptPubKeyMan if descriptor wallet
1 parent 96accc7 commit aeac157

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/wallet/wallet.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4353,6 +4353,9 @@ std::unique_ptr<SigningProvider> CWallet::GetSolvingProvider(const CScript& scri
43534353

43544354
LegacyScriptPubKeyMan* CWallet::GetLegacyScriptPubKeyMan() const
43554355
{
4356+
if (IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
4357+
return nullptr;
4358+
}
43564359
// Legacy wallets only have one ScriptPubKeyMan which is a LegacyScriptPubKeyMan.
43574360
// Everything in m_internal_spk_managers and m_external_spk_managers point to the same legacyScriptPubKeyMan.
43584361
auto it = m_internal_spk_managers.find(OutputType::LEGACY);
@@ -4368,7 +4371,7 @@ LegacyScriptPubKeyMan* CWallet::GetOrCreateLegacyScriptPubKeyMan()
43684371

43694372
void CWallet::SetupLegacyScriptPubKeyMan()
43704373
{
4371-
if (!m_internal_spk_managers.empty() || !m_external_spk_managers.empty() || !m_spk_managers.empty()) {
4374+
if (!m_internal_spk_managers.empty() || !m_external_spk_managers.empty() || !m_spk_managers.empty() || IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
43724375
return;
43734376
}
43744377

0 commit comments

Comments
 (0)